I need help with my code for editing a drop down value in ASP.Net. I am having some problems. I am not getting an error message. It will show all of the options. It will show the selected value. But it won't let me edit it correctly. When I edit it, it gives a random ClientID instead of the correct ClientID. I am not sure what's wrong.
Can someone please look at my code especially the bolded parts to see what might be wrong?
Here's my code:
'------------------------------------------------------------
' name: DisplayAsString( _objFieldValue as object) As String
'------------------------------------------------------------
Function DisplayAsString( _objFieldValue as object) As String
dim strDisplay as String
if _objFieldValue Is System.DBNull.Value then
&nbs p; strDisplay = String.Empty
else
&nbs p; strDisplay = _objFieldValue.ToString()
end if
return strDisplay
End Function
'----------------------------------------------------------------
' name: BindDropDownList()
'----------------------------------------------------------------
Sub BindDropDownList( _strDomID as String )
Dim BusinessNameValue As String
Dim strSQL as String
Dim strConnect As String
Dim conClient As SqlConnection
Dim cmdSelect As New System.Data.SqlClient.SQLCommand
Dim dtrClient As SqlDataReader
'Get connection string from Web.Config