B
Big E
Okay here is my code. I'm using ASP.Net and SQL Server 2000. When I run this
code the selecteditem.value is 1 the selecteditem.text is ALABAMA. This is
correct. But when I try and get the value once this procedure has run my
selecteditem.value is ALABAMA and the selecteditem.text is ALABAMA. It's not
keeping the selecteditem.value after I change the combobox selection.
Thanks.
Big E
Dim Portal As String
Dim dsState As DataSet
Dim cnPortal As SqlConnection
Dim daState As SqlDataAdapter
Dim dtState As DataTable = New DataTable
Portal = ConfigurationSettings.AppSettings("Portal.ConnectionString")
dsState = New DataSet
cnPortal = New SqlConnection(Portal)
daState = New SqlDataAdapter("SELECT * FROM tlkpState", cnPortal)
daState.Fill(dsState, "tlkpState")
dtState = dsState.Tables("tlkpState")
Dim i As Integer
For i = 0 To dtState.Rows.Count - 1
cboStateCompany.Items.Add(dtState.Rows(i)("StateCode"))
cboStateCompany.SelectedItem.Value = (dtState.Rows(i)("StateId"))
cboStateCompany.SelectedItem.Text = (dtState.Rows(i)("StateCode"))
Next
cnPortal.Close()
cnPortal = Nothing
code the selecteditem.value is 1 the selecteditem.text is ALABAMA. This is
correct. But when I try and get the value once this procedure has run my
selecteditem.value is ALABAMA and the selecteditem.text is ALABAMA. It's not
keeping the selecteditem.value after I change the combobox selection.
Thanks.
Big E
Dim Portal As String
Dim dsState As DataSet
Dim cnPortal As SqlConnection
Dim daState As SqlDataAdapter
Dim dtState As DataTable = New DataTable
Portal = ConfigurationSettings.AppSettings("Portal.ConnectionString")
dsState = New DataSet
cnPortal = New SqlConnection(Portal)
daState = New SqlDataAdapter("SELECT * FROM tlkpState", cnPortal)
daState.Fill(dsState, "tlkpState")
dtState = dsState.Tables("tlkpState")
Dim i As Integer
For i = 0 To dtState.Rows.Count - 1
cboStateCompany.Items.Add(dtState.Rows(i)("StateCode"))
cboStateCompany.SelectedItem.Value = (dtState.Rows(i)("StateId"))
cboStateCompany.SelectedItem.Text = (dtState.Rows(i)("StateCode"))
Next
cnPortal.Close()
cnPortal = Nothing