0

hi

i have 100 records in my datatable .Here i want to insert these records into SQL without looping .

thanks

6
Contributors
5
Replies
7
Views
6 Years
Discussion Span
Last Post by Pgmer
0
insert into dbname.destination_table_name (dest_col1,dest_col2,dest_col3) 
select source_col1,source_col2,source_col3 
from dbname.source_table_name 
where some_colname='some condition'

Edited by urtrivedi: n/a

0

hi

i have 100 records in my datatable .Here i want to insert these records into SQL without looping .

thanks

For You Have to Use

Bulk Query Concept Like Batch Processing....

string qry="";
For(int i=0;i<100;i++)
{
qry+="insert into tbl(id,name) values (1,'chirag')";
}
cmd.CommandType=qry;
cmd.executenonQuery();

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.