By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
[(ASP.NET) codebehind = VB.NET) to populate a ListBox WebServer Control]
Would you please tell me what is wrong with the following code? It is not populating the ListBox control.
Dim strCmd As String strCmd = "select beat_no, descr from crv_gelbeat" CRSDBConnect.Open() Dim oCMD As New SqlDataAdapter(strCmd, CRSDBConnect) Dim oDS As New DataSet oCMD.Fill(oDS, "BeatList") Dim dt As DataTable = oDS.Tables("BeatList") dt.Columns.Add("BeatNumberDesc", Type.GetType ("System.String"), "beat_no + ' - ' + descr") lstGeoLeftPane.DataSource = oDS.Tables("BeatList").DefaultView lstGeoLeftPane.DataTextField = "BeatNumberDesc" lstGeoLeftPane.DataValueField = "beat_no"
Are you calling lstGeoLeftPane.DataBind() after that?
Dig Deeper on Win Development Resources
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ...continue reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers.continue reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.