Batch Update/insert in using SQLCommand in C#

Viewed 24721

How I could achieve batch update/insert using SQLCommand. I wanted to create SQLCommand text dynamically in for loop of MyObject[] in C# with 10 SQLParameter

in case of bulk insert, i need to check for every record that it already exist or not. i.e.

if not Exists(select pkid from table1 where fkid1=@fkid1 and fkid2=@fkid1)

begin

insert....

end

This is to be done from C#.No stored procedure in db

5 Answers
Related