Author: smitty68521 | Posted on: 10/24/2008 1:41:45 AM | Views : 279

I am currently working on a project that is basically an edit page. What I am trying to do is have the initial selected value of the ddl be what is currently in the database. The user will then be able to select from the dropdown list a choice of what he/she wants to change it to. I have the following code:
Dim ID As Integer

If String.IsNullOrEmpty(Request.QueryString("prop")) = False Then
ID = Request.QueryString("prop").ToString()
Else
label1.text = "sorry, it didn't work"
End If


Dim connectionstring As String = ("Myconnection")
Dim query As String = ("select available from properties where ID=@ID")
Dim conn As New SqlConnection("myconnection)
Dim cmd As New SqlCommand(query, conn)
cmd.Parameters.AddWithValue("@available", availableddl.SelectedItem.Va ...

Go to the complete details ...