I am using the code below to connect to a Access database and the first time roumd it works perfectly but then it errors. I think that the datatable might need clearing but i dont no how to do this. Can anybody tell me ho to solve this problem?? Thanks
Dim connStr As String = "Provider = Microsoft.Jet.OLEDB.4.0;" & _
"Data Source = G2G.mdb"
Dim squlStr As String = "SELECT * From Staff WHERE ((Staff_No=" & StaffnoTxt.Text & "))"
Dim oleDbStaffAdapter As New OleDb.OleDbDataAdapter(squlStr, connStr)
Dim oDataTable As New DataTable
oleDbStaffAdapter.Fill(oDataTable)
FnameTxt.DataBindings.Add(New Binding("Text", oDataTable, "First_Name"))
LastnameTxt.DataBindings.Add(New Binding("Text", oDataTable, "Surname"))
NoTxt.DataBindings.Add(New Binding("Text", oDataTable, "Tel_No"))
PcodeTxt.DataBindings.Add(New Binding("Text", oDataTable, "Post_Code"))
DoornoTxt.DataBindings.Add(New Binding("Text", oDataTable, "House"))
Thanks