J
jaYPee
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.
my 3 tables looks like the 3 tables from northwind database that has
an employees, orders, and order details.
the following are the 3 tables in my sql database
students
schyrsem
SchYrSemCourse
here's some variables i have
Private dsStudentCourse As DataSet
Private dtStudents As DataTable
Private dtSchYrSem As DataTable
Private dtSchYrSemCourse As DataTable
Private dvSchYrSem As DataView
Private dvSchYrSemCourse As DataView
Private sda As SqlDataAdapter
here's some of the code to fill the dataset
Dim scnnNW As New SqlConnection(strConn)
Dim strSQL As String = _
"SELECT IDNo, LastName, FirstName " & _
"FROM Students"
Dim scmd As New SqlCommand(strSQL, scnnNW)
sda = New SqlDataAdapter(scmd)
Dim scb As New SqlCommandBuilder(sda)
scb.GetUpdateCommand()
dsStudentCourse = New DataSet()
sda.Fill(dsStudentCourse, "Students")
scmd.CommandText = _
"SELECT SchYrSemID, IDNo, SchYr, Sem FROM
SchYrSem"
sda.Fill(dsStudentCourse, "SchYrSem")
scmd.CommandText = _
"SELECT SchYrSemCourseID, SchYrSemID,
Course.CourseID, CourseTitle, CourseDesc, Unit, [Hours/Week] FROM
Course INNER JOIN SchYrSemCourse ON Course.CourseID =
SchYrSemCourse.CourseID"
sda.Fill(dsStudentCourse, "SchYrSemCourse")
dtStudents = dsStudentCourse.Tables(0)
dtSchYrSem = dsStudentCourse.Tables(1)
dtSchYrSemCourse = dsStudentCourse.Tables(2)
dvSchYrSem = dtSchYrSem.DefaultView
dvSchYrSemCourse = dtSchYrSemCourse.DefaultView
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.
i would be very if someone can enlighten me on how to save a dataset
that has a multiple table in it.
articles but still i don't know how to update the dataset that has 3
tables.
my 3 tables looks like the 3 tables from northwind database that has
an employees, orders, and order details.
the following are the 3 tables in my sql database
students
schyrsem
SchYrSemCourse
here's some variables i have
Private dsStudentCourse As DataSet
Private dtStudents As DataTable
Private dtSchYrSem As DataTable
Private dtSchYrSemCourse As DataTable
Private dvSchYrSem As DataView
Private dvSchYrSemCourse As DataView
Private sda As SqlDataAdapter
here's some of the code to fill the dataset
Dim scnnNW As New SqlConnection(strConn)
Dim strSQL As String = _
"SELECT IDNo, LastName, FirstName " & _
"FROM Students"
Dim scmd As New SqlCommand(strSQL, scnnNW)
sda = New SqlDataAdapter(scmd)
Dim scb As New SqlCommandBuilder(sda)
scb.GetUpdateCommand()
dsStudentCourse = New DataSet()
sda.Fill(dsStudentCourse, "Students")
scmd.CommandText = _
"SELECT SchYrSemID, IDNo, SchYr, Sem FROM
SchYrSem"
sda.Fill(dsStudentCourse, "SchYrSem")
scmd.CommandText = _
"SELECT SchYrSemCourseID, SchYrSemID,
Course.CourseID, CourseTitle, CourseDesc, Unit, [Hours/Week] FROM
Course INNER JOIN SchYrSemCourse ON Course.CourseID =
SchYrSemCourse.CourseID"
sda.Fill(dsStudentCourse, "SchYrSemCourse")
dtStudents = dsStudentCourse.Tables(0)
dtSchYrSem = dsStudentCourse.Tables(1)
dtSchYrSemCourse = dsStudentCourse.Tables(2)
dvSchYrSem = dtSchYrSem.DefaultView
dvSchYrSemCourse = dtSchYrSemCourse.DefaultView
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.
i would be very if someone can enlighten me on how to save a dataset
that has a multiple table in it.