hi

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

thanks

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.