hi

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

thanks

Recommended Answers

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'
Jump to Post

All 5 Replies

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'

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();

100 record is not bulk for sql..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.