is it just me?

Need4vB

New Member
Ok, I've got a list of states that i'm using in a form. I've binded the dropdownlistbox to my db as such:<BR> Private Sub LoadStates()<BR> Dim DS As DataSet<BR> Dim Cmd As SqlDataAdapter<BR> Dim sPro As String<BR> Dim oCnn As SqlConnection<BR><BR> oCnn = New SqlConnection()<BR> oCnn.ConnectionString = Application("app_DBConnectionString")<BR> Cmd = New SqlDataAdapter("GET_STATES", oCnn)<BR><BR> DS = New DataSet()<BR> Cmd.Fill(DS, "STATE_NAME")<BR><BR> ddlist.DataSource = DS.Tables("STATE_NAME").DefaultView<BR> ddlist.DataValueField = "STATE_ID"<BR> ddlist.DataTextField = "STATE_NAME"<BR><BR> ddlist.DataBind()<BR> End Sub<BR><BR>So, it loads ok and all of my states show up but when i'm ready to get my state data <BR>ddlist.selecteditem.value <BR>I keep getting the first value. I'm beginning to think that i have something setup incorrectly or something as I have the same problem with my checkboxlist giving me incorrect data. Any suggestions would be greatly appreciated.Show us the dropDownList control
 
Back
Top