When I run this code:
Private Sub submit_org_nm_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit_org_nm_btn.Click
'org_nm_selection = org_nm_tb.Text
Dim strSql As String
Dim strConn As String = ConfigurationSettings.AppSettings("ConnectstrW"
Dim conn As New SQLConnection(strConn)
strSql = "select org_nm from grant_info where org_nm like '" + org_nm_tb.Text + "%' "
Dim cmd As New SqlCommand(strSql, conn)
conn.Open()
candidate_orgs.datasource = cmd.ExecuteReader()
candidate_orgs.databind()
conn.Close()
End Sub
I get this error:
An invalid data source is being used for candidate_orgs. A valid data source must implement either IListSource or IEnumerable.
candidate_orgs is a (properly declared) dropdownlist.
What is wrong with this?
Thanks!
Lazer
Private Sub submit_org_nm_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles submit_org_nm_btn.Click
'org_nm_selection = org_nm_tb.Text
Dim strSql As String
Dim strConn As String = ConfigurationSettings.AppSettings("ConnectstrW"
Dim conn As New SQLConnection(strConn)
strSql = "select org_nm from grant_info where org_nm like '" + org_nm_tb.Text + "%' "
Dim cmd As New SqlCommand(strSql, conn)
conn.Open()
candidate_orgs.datasource = cmd.ExecuteReader()
candidate_orgs.databind()
conn.Close()
End Sub
I get this error:
An invalid data source is being used for candidate_orgs. A valid data source must implement either IListSource or IEnumerable.
candidate_orgs is a (properly declared) dropdownlist.
What is wrong with this?
Thanks!
Lazer