Hi All,
I am attempting to use my first Typed Dataset. I admit that it simplifies the data access code of my application, and appears to be nice so far. I can not, however, figure out how to get it to insert new records back into my database.
My Dataset is called AppData. In it I've got one DataTable called Genre which relates back to a table in my database with the same name.
The Genre DataTable has only the default query built for it (Fill, and GetData.) Also, the GenerateDBDirectMethods property is set to true, and the SQL statements that were generated are valid.
I am trying to write the code that inserts a single new record into the Genre table. Here's what I wrote:
When I execute the code, it doesn't generate any errors, but when I look in the database table, the record was not inserted. Can someone please explain why this is, and how to accomplish what I am attempting? Thanks!
-Funger
I am attempting to use my first Typed Dataset. I admit that it simplifies the data access code of my application, and appears to be nice so far. I can not, however, figure out how to get it to insert new records back into my database.
My Dataset is called AppData. In it I've got one DataTable called Genre which relates back to a table in my database with the same name.
The Genre DataTable has only the default query built for it (Fill, and GetData.) Also, the GenerateDBDirectMethods property is set to true, and the SQL statements that were generated are valid.
I am trying to write the code that inserts a single new record into the Genre table. Here's what I wrote:
VB.NET:
Dim ta As New AppDataTableAdapters.GenreTableAdapter
ta.Insert(1234, "New Genre", "Description of new Genre")
ta = Nothing
When I execute the code, it doesn't generate any errors, but when I look in the database table, the record was not inserted. Can someone please explain why this is, and how to accomplish what I am attempting? Thanks!
-Funger