Check out SqlBulkCopy class

You will have to copy all the selected rows in a datatable

Map the columns of the datatable to your sql table

Open the connection and c the magic ;-)


On Sep 8, 8:28 pm, afshin foroodi <[email protected]> wrote:
> Hi
> I have a GridView in ASP.NET C# application user can select records from
> gridview when they click the button I want to add selected rows to another
> table in database sql server
> I know one way to loop through grid and connect to database and add the
> record but I am wondering is there a better way to do this in one shot

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to