Learn the difference between a dataset and datatable, and not bothering to copy the records again into the datatable, I'm use to using the old VB6 recordsets...bloody much easier :rolleyes:
hmm...isn't..QuestionDS ("questions") a dataset, I thought you needed to put all the records in a dataset first and then fill up a datatable. Are dataset and datatable the same thing?? :confused:
Hmm sorry for the confusion....and I'm a newbie when it comes to vb.net but the sample code which I posted...it that of ONE datatable which I'm having problems to load data into. I did try using two datatables before however to no success. (I seriously do not explain complex things to well lol)...
The error occurs I think when it trys to add the Quest_ID to the datatable, because it knows Question_ID in the Question table has a relationship with the Quest_ID in the Answers table. So it breaks at:
QuestionNewRow("Quest_ID") = QuestionDSRow("Quest_ID")
I've tried using...
Forgot to add, I'm doing this as a mobile application...which means using the Compact Framework.
Run the SQL and here is the data:
Question_ID Question Answer_ID Answer CorrectAnswer Quest_ID
1 What is OOP? 1 Object oriented programming allows...
I have a small problem, which I've spend the whole day trying to work out, and need some help on. I'm retrieving data from two tables, and putting into a datatable.
Heres the code:
Try
'Open up the connection object
SQLtestconn = New SqlConnection...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.