I am new to programming and to stackoverflow. I need help on sql server 2008 and asp.net. I need to save multiple rows in database using gridview in asp.net. So for every row in gridview I ahve to open and close the connection in asp.net. Does opening and closing for every row has disadvantages. If any please tell.
preguntado el 05 de mayo de 13 a las 15:05
fill the datatable with new rows send it to your DAL method , open the connection once and add rows one by one and after adding all rows close the connection
again fill the datatable with new rows send it to your dal method , open the connection and use sqlbulkcopy class to add the rows at once.
and best approch is to use sqlbulkcopy
more one sqlbulkcopy can be found aquí