By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,656 Members | 800 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,656 IT Pros & Developers. It's quick & easy.

Help Clearing Data in Data Table

P: 10
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
Dec 4 '07 #1
Share this Question
Share on Google+
1 Reply


Plater
Expert 5K+
P: 7,872
It looks ok to me?
Maybe there is something about the DataBindings stuff restricting your ability to overwrite the data in a DataTable?
Dec 4 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.