Hi,
I'm trying to bind a DropDownList in the code behind using the following code:
Dim DatabaseConnection As New SqlConnection(ConfigurationManager.ConnectionStrings("myServer").ConnectionString)
Dim selectCMD As String = “SELECT name, id FROM Clients WHERE name LIKE @name + ‘%’”
Dim selectCMD As New SqlCommand(selectSQL, DatabaseConnection)
selectCMD.Parameters.Add(New SqlParameter("@name", SqlDbType.VarChar))
selectCMD.Parameters("@name").Value = name
Dim adapter As New SqlDataAdapter
Dim dTable As New DataTable
adapter.SelectCommand = selectCMD
adapter.Fill(dTable)
ddl.DataSource = dTable
ddl.DataBind()
But the values that are being bound to the DDL are all = System.Data.DataRowView. Any ideas of what is wrong?