I have two tables in SQL Server.
Table one contains these columns:
1-id
2-name
3-family
4-address
and table two contains these columns:
1-id
2-name
In table one I have 100000 rows and read all record with this query:
var query = (from p in datacontext.table1
select p).toArray();
I want insert all data from up query into the table2, now I use this method:
for(int i = 0; i < query.count(); i++) {
table2 beh = new tabl2();
beh.name = query[0].name;
datacontext.table2.insertonsubmit(beh);
datacontext.submitchange();
}
Is there another way? Thanks.