0

I have a datagrid on windows form which represents specific columns from two tables.I need the code for the SQL join and insert

C# and SQL Join and Insert

18th May 2019, 6:37 PM
JASON
JASON - avatar
6 Answers
+ 9
I don't know if you want to show the records on the data grid or to insert from text boxes to the database but here is a question same to yours already asked in stack overflow : https://stackoverflow.com/questions/37121494/insert-join-sql-server-from-windows-forms/37121695#37121695
18th May 2019, 7:04 PM
Why So Serious ?
Why So Serious ? - avatar
+ 9
Here is the code of inserting data into a table https://code.sololearn.com/c8Kk8ovrzO5q/?ref=app
18th May 2019, 7:30 PM
Why So Serious ?
Why So Serious ? - avatar
+ 1
You cannot insert records into two tables with one statement. For "update" two tables at the same time you need to create a transaction with two insert. In T-SQL is something like: Begin transaction Insert into TableOne... // If need identity value from first insert Declare @Id int = @@scope_identity Insert into TableTwo... Commit For .Net depends on which framework you are using.
21st May 2019, 10:20 PM
Eymerich
0
I wanna insert from text boxes to the database
18th May 2019, 7:10 PM
JASON
JASON - avatar
0
I wanna code for join-insert in sql
18th May 2019, 8:10 PM
JASON
JASON - avatar
0
Okay thanks
21st May 2019, 10:21 PM
JASON
JASON - avatar