DropDownlist

S

Sam

I would like to know why no DropDownList id value ?

Coding
-------

sub page_load()

Dim con As New
SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))

Dim cmd As New SqlCommand()
cmd.CommandText = "Select gl_date,gl_date_value from gldate"
cmd.Connection = con

Try
con.Open()

Dim rd As SqlDataReader = cmd.ExecuteReader()

DropDownlist_Date.DataSource = rd
DropDownlist_Date.DataTextField = "gl_date"
DropDownlist_Date.DataValueField = "gl_date_value"
DropDownlist_Date.DataBind()

rd.Close()

Finally
con.Close()
End Try

End Sub

<asp:DropDownList id="DropDownlist_Date" runat="server"></asp:DropDownList>
 
S

Sam

example record in database via dropdownlist
1st record : 2001
2nd record : 2002
...
10th record : 2010

It always selected 1st record which it is 2001 although other selection is
made.

Why dropdownbliast value is alwasy point to 2001?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,279
Latest member
LaRoseDermaBottle

Latest Threads

Top