J
julie6232000
I don't want the users to type in any new items but select only what is
on the list.
Here's my code to load the ASPropDownList:
'----------------------------------------------------------------------------
'-- ADD ITEMS TO THE TYPE DROP DOWN BOX
'----------------------------------------------------------------------------
sqlCMD.Connection = New
SqlConnection(ConfigurationSettings.AppSettings("con"))
sqlCMD.CommandType = CommandType.StoredProcedure
sqlCMD.CommandText = "usp_GetAppType"
sqlCMD.Connection.Open()
myReader = sqlCMD.ExecuteReader()
If myReader.HasRows Then
'Add blank first item. Note this will be the default
selection but user must select another value
Me.ddlType.Items.Add("")
Do While myReader.Read()
i = New ListItem(myReader.GetString(0))
Me.ddlType.Items.Add(i)
Loop
Else
i = New ListItem("No items returned")
Me.ddlType.Items.Add(i)
End If
myReader.Close()
sqlCMD.Connection.Close()
'Remove ALL from the type of application drop down list
Me.ddlType.Items.Remove("ALL")
Me.ddlType.SelectedIndex = 0
on the list.
Here's my code to load the ASPropDownList:
'----------------------------------------------------------------------------
'-- ADD ITEMS TO THE TYPE DROP DOWN BOX
'----------------------------------------------------------------------------
sqlCMD.Connection = New
SqlConnection(ConfigurationSettings.AppSettings("con"))
sqlCMD.CommandType = CommandType.StoredProcedure
sqlCMD.CommandText = "usp_GetAppType"
sqlCMD.Connection.Open()
myReader = sqlCMD.ExecuteReader()
If myReader.HasRows Then
'Add blank first item. Note this will be the default
selection but user must select another value
Me.ddlType.Items.Add("")
Do While myReader.Read()
i = New ListItem(myReader.GetString(0))
Me.ddlType.Items.Add(i)
Loop
Else
i = New ListItem("No items returned")
Me.ddlType.Items.Add(i)
End If
myReader.Close()
sqlCMD.Connection.Close()
'Remove ALL from the type of application drop down list
Me.ddlType.Items.Remove("ALL")
Me.ddlType.SelectedIndex = 0