Dataset updating multiple tables
i tried your source code just the update only to simplify my problem here's the source code modified from what you have told me to do.
Ibrahim "ja YPee" Hi, Thank u very much for the reply.
the following are the 3 tables in my sql database students schyrsem Sch Yr Sem Course here's some variables i have Private ds Student Course As Data Set Private dt Students As Data Table Private dt Sch Yr Sem As Data Table Private dt Sch Yr Sem Course As Data Table Private dv Sch Yr Sem As Data View Private dv Sch Yr Sem Course As Data View Private sda As Sql Data Adapter here's some of the code to fill the dataset Dim scnn NW As New Sql Connection(str Conn) Dim str SQL As String = _ "SELECT IDNo, Last Name, First Name " & _ "FROM Students" Dim scmd As New Sql Command(str SQL, scnn NW) sda = New Sql Data Adapter(scmd) Dim scb As New Sql Command Builder(sda) scb.
my 3 tables looks like the 3 tables from northwind database that has an employees, orders, and order details.
Get Update Command() ds Student Course = New Data Set() sda. Command Text = _ "SELECT Sch Yr Sem ID, IDNo, Sch Yr, Sem FROM Sch Yr Sem" sda. Command Text = _ "SELECT Sch Yr Sem Course ID, Sch Yr Sem ID, Course. Fill(ds Student Course, "Sch Yr Sem Course") dt Students = ds Student Course. Tables(1) dt Sch Yr Sem Course = ds Student Course. Default View dv Sch Yr Sem Course = dt Sch Yr Sem Course. If you have 'updates, inserts, and deletes happening in all of 'the datase's tables then yoyu have to submit things 'in order.
Course ID, Course Title, Course Desc, Unit, [Hours/Week] FROM Course INNER JOIN Sch Yr Sem Course ON Course. Default View i have also search the msdn for updating a multiple table but all i can see is on how to save a single table only. 'submit all the inserts first starting from the 'top table on down My AD1.
Right-click on the Designer, select the Add option from the context menu, and pick the Table Adapter menu item. This will run the stored procedure and show its results in the Output window (see Figure 9). Alternatively, we could have added these columns manually to the Data Table. NET books and founder of 4Guys From Rolla.com, has been working with Microsoft Web technologies since 1998. or via his blog, which can be found at On Writing. This tutorial series was reviewed by many helpful reviewers.
This will launch the Table Adapter Configuration wizard. Figure 9: The Stored Procedures Results are Displayed in the Output Window (Click to view full-size image) At this point, the We have explored manually adding Data Table columns in previous tutorials, including Master/Detail Using a Bulleted List of Master Records with a Details Data List and Uploading Files, and we will look at this process again in more detail in our next tutorial. We will explore manually adding columns to the Data Table in the next tutorial. Scott works as an independent consultant, trainer, and writer. Lead reviewers for this tutorial were Hilton Geisenow, David Suru, and Teresa Murphy.
For a refresher on creating new stored procedures from the Table Adapter s wizard, consult the Creating New Stored Procedures for the Typed Data Set s Table Adapters tutorial. Start by right-clicking on the and selecting Configure from the context menu.
If there'are parent/child relationships involed here then you'have to break up the process lets say the tables'are 1 parent to two that is parent to 3.
Modified Current))'finally submit the deletions from the bottom up My AD3.
"ja YPee" I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables.
and yes this is a parent-child form On Mon, -0700, "Ibrahim Malluf" Hello jay'in the example code below it is assumed that each data'adapter (My AD1, My AD2, My Ad3) have commands for update'delete and inserts for the respective tables they are'managing.