DropDown returns only System.Data.dataRowview
New DiscussionHi,
When I bind the DropDown on the codebehind, the Dropdown populates with
System.Data.DataRowView for as many records as there are.
Why is the actual data not being populated?
Mark up is as follows
<
ig:WebDropdown ID="ddlSearch" runat="server" Visible="False" AutoPostBack="True" DropDownContainerHeight="0px" EnableAutoFiltering="Server" EnableLoadOnDemand="True"><AutoPostBackFlags SelectionChanged="On" ValueChanged="On" /></ig:WebDropdown>
My code in behind is as follows
Dim sqlConn As SqlConnection
Dim comm As SqlCommand
Dim da As SqlDataAdapter
Dim ds As New DataSet
sqlConn = New SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Try
comm = New SqlCommand("SELECT Col1 FROM XYZ", sqlConn)
comm.CommandType = CommandType.Text
sqlConn.Open()
comm.ExecuteNonQuery()
da = New SqlDataAdapter(comm)
da.Fill(ds)
da.Dispose()
For i As Integer = 0 To ds.Tables(0).Rows.Count – 1
ddlSearchShip.DataSource = ds
ddlSearchShip.DataBind()
ddlSearchShip.TextField = "Col1"
Next
Catch ex As Exception
Response.Write(ex)
End Try
sqlConn.Close()
sqlConn.Dispose()