E
et
How would I display the value of multiple fields in a drop down list in a
bound datagrid. I tried changing the DataTextField to include both fields,
but received an error: ddl.DataTextField = "CountyName" & "CountyCode" to
display something like this:
"Burrough County (BC)"
This is my current code:
Dim qry As String = "SELECT CountyCode, CountyName from tblCounties"
Dim da As SqlDataAdapter = New SqlDataAdapter(qry, strConn)
Dim ds As New DataSet
Dim item As ListItem
da.Fill(ds, "tblCounties")
ddlCropCode.DataTextField = "CountyName"
ddlCropCode.DataValueField = "CountyID"
ddlCropCode.DataBind()
Can
bound datagrid. I tried changing the DataTextField to include both fields,
but received an error: ddl.DataTextField = "CountyName" & "CountyCode" to
display something like this:
"Burrough County (BC)"
This is my current code:
Dim qry As String = "SELECT CountyCode, CountyName from tblCounties"
Dim da As SqlDataAdapter = New SqlDataAdapter(qry, strConn)
Dim ds As New DataSet
Dim item As ListItem
da.Fill(ds, "tblCounties")
ddlCropCode.DataTextField = "CountyName"
ddlCropCode.DataValueField = "CountyID"
ddlCropCode.DataBind()
Can