Link to home
Start Free TrialLog in
Avatar of ADawn
ADawn

asked on

Howto: Fill some textboxes using a dataset

I'm trying the fill some textboxes with data from a dataset - code below. It keeps telling that table 0 doesn't exist. Is there a better way to fill these textboxes than the way I'm going at it?


Dim MyConn As New Data.OleDb.OleDbConnection(gstr_ConnString)

strSQL = "Select * From tbl_Unit WHERE Unit_AutoID ='" & g_lng_AutoID & "';"

Dim DS_Details As New DataSet
Dim DA4 As New OleDb.OleDbDataAdapter(strSQL, MyConn)

Me.txtColors.Text = DS_Details.Tables(0).Rows(0).Item("Unit_Color")
Me.txtShapes.Text = DS_Details.Tables(0).Rows(0).Item("Unit_Shape")

MyConn.Close()



ADawn
       
SOLUTION
Avatar of Joe_Griffith
Joe_Griffith

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial