3

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?

Adrian Wragg
  • 7,311
  • 3
  • 26
  • 50
Sertan Pekel
  • 593
  • 2
  • 5
  • 23
  • 1
    SqlCommandBuilder does not supports multiple table updates however you can use different `datadapters` for update Check this link http://pietschsoft.com/post/2004/08/22/Fill-DataSet-with-multiple-Tables-and-update-them-with-DataAdapter – Suraj Singh Aug 21 '13 at 11:18

1 Answers1

2
UPDATE L
SET <col> = <value>
FROM Lessons AS L
INNER JOIN CLasses ON L.LessonID = Classes.ClassID
GrandMasterFlush
  • 6,269
  • 19
  • 81
  • 104