Question : Problem Binding Data to a textbox in Vb.Net

I am using Visual Studio 2005 VB.Net

I am trying to with code have a form pop up with text boxes filled from a table..

This is the code I have on the form load

       Dim strSql2 As String
        Dim da As SqlClient.SqlDataAdapter
        Dim ds As DataSet = New DataSet
        Dim lnId As Long
        lnId = 4283 ' hard coded value to test
        con.Open()
        strSql2 = "Select lID,sName from tCust where lid = " & lnId & ""
        da = New SqlDataAdapter(strSql2, con)
        da.Fill(ds, "cust")
        txtCustID.DataBindings.Add("Text", ds, "tCust.lID")
        txtsName.DataBindings.Add("Text", ds, "tCust.sName")
        con.Close()

I get an error "Child list for field tCust.lID cannot be created"..

I have checked the field name and it is correct..

Any help or insight would be much appreciated..

Answer : Problem Binding Data to a textbox in Vb.Net

Random Solutions  
 
programming4us programming4us