Last post Apr 19, 2011 10:23 PM by LoupArgent
Apr 07, 2011 01:16 AM|LoupArgent|LINK
Hi! Is there any way I could insert a record in multiple tables using only a single post? So far I could insert records in a single table using formsview and detailsview but it only allow me to insert records in one table. I have 4 tables and each has foreign
keys and dependencies with other tables.
Any help will be appreciated.
Apr 07, 2011 02:43 AM|adeelehsan|LINK
Apr 09, 2011 10:27 PM|Decker Dong - MSFT|LINK
The 2nd man's idea should be nice, you can try it first：）
Another way is that you can use a SqlCommand with a SqlConnection, with which you can do several times inserting with some values, Something looks like this：
SqlConnection con = new SqlConnection("Connection String ……");
SqlCommand cmd = new SqlCommand("Insert Statement 1",con);
con.ChangeDataBase(New DataBase Name);
cmd.CommandText = "Insert Statement 2";
Apr 19, 2011 10:23 PM|LoupArgent|LINK
Thanks! I could use this also ;)