Submit GridView to database at a time

Posted by Suneel161 under Regular Expressions on 3/24/2010 | Views : 5593 | Status : [Member] | Replies : 3
Hi all,
how to submit 10 records of the GridView to Database at a time.and after that gridview will be empty...




Responses

Posted by: Raja on: 3/24/2010 [Member] Starter

Up
0
Down
I hope below description will give you an idea.

Loop through all the rows of the GridView using below code snippet and get the columns data and save into the database.

foreach (GridViewRow row in GridView1.Rows)

{
// use row.DataColumns to retrive the column data
// get all columns data and save into the database
}


Then set GridView1.DataSource = null that will empty the GridView.



Regards,
Raja, USA

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sagarp on: 3/24/2010 [Member] Bronze

Up
0
Down
check following links

http://forums.asp.net/t/1152078.aspx


Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Lakhangarg on: 3/25/2010 [Member] [Moderator] Silver

Up
0
Down
Hi-

You can use the bulk insert for that.

Thanks
Lakhan Pal Garg

Suneel161, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response