SqlCommandBuilder Inner Join Update

1.6k views Asked by At

I have SQL tables as Lessons and Classes. Lessons table has primary key LessonID and Classes table has primary key ClassID. Also ClassID column is foreign key at Lessons table. I import data with SqlDataAdapter to DataSet in C# using query:

select * from Lessons
    inner join Classes on Lessons.LessonID=Classes.ClassID".

I add ddata and edit DataSet via windows form. But it is time to update. I do not know how to update DataSet with SqlDataAdapter because of SqlCommandBuilder does not support "inner join" function. Any ideas?

1

There are 1 answers

0
GrandMasterFlush On BEST ANSWER
UPDATE L
SET <col> = <value>
FROM Lessons AS L
INNER JOIN CLasses ON L.LessonID = Classes.ClassID