Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not binding with dropdown control

Status
Not open for further replies.

josie2007

Technical User
Apr 14, 2007
90
US
For some reason the result from my query is not binding with the dropdown control..any hint would be appreciated

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
lettingDate()
End If
End Sub

Sub lettingDate()
Dim connectionString As String = ConnectionStrings("ConnectionString").ConnectionString
Dim oOracleConn As OracleConnection = New OracleConnection(connectionString)

Dim strStringBuilder As StringBuilder
strStringBuilder = New StringBuilder
With strStringBuilder
.Append(" select distinct b.datelet ")
.Append(" from bidlet b , letprop l ")
.Append(" where datelet > to_date('12/31/2004','MM/DD/YYYY') ")
.Append(" and datelet < trunc(sysdate) ")
.Append(" and l.letting = b.letting ")
.Append(" AND SUBSTR (l.lcontid, 4, 4) <= '5' ")
.Append(" order by datelet ")
End With
Dim cmdLetting As OracleCommand = New OracleCommand()
cmdLetting.Connection = oOracleConn
cmdLetting.CommandType = CommandType.Text
cmdLetting.CommandText = strStringBuilder.ToString
Dim adLetting As New OracleDataAdapter(cmdLetting)
Dim dsLetting As New DataSet
adLetting.Fill(dsLetting, "LettingDate")
ddLetting.DataSource = dsLetting
ddLetting.DataBind()
End Sub
 
Does the dataset actually get populated? Does it contain the data you expected? Do you get any errors?

Also, have a read up on the DataTextField and DataValueField properties.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
yes, it does get populated. Yes, it contains the data that I expected and I do not get an error message.
 
I thinks I got it to work now.thanks ca8msm for the suggested topics DataTextfield and Datavalefield properties.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top