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
6 Antworten
+ 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
+ 9
Here is the code of inserting data into a table
https://code.sololearn.com/c8Kk8ovrzO5q/?ref=app
+ 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.
0
I wanna insert from text boxes to the database
0
I wanna code for join-insert in sql
0
Okay thanks