Help me to store my Grid View data in database in asp.net
-
Friday, April 13, 2012 2:06 AMI an doing a project in asp.net and here i am filling up my gridview from an excel file. Upto here its ok... now after the datas are filled from a excel in my grid i want to save these data to my sql server table "RCBook". I have columns such as name, regno, date, size, weight and so on. Plz tell me how to save it in my database bcoz afterwords i have to take out particular record from it when some customer queries....
All Replies
-
Friday, April 13, 2012 5:12 AM
Simply speaking,I think you can:
Use OleDbDataReader with Batch-Insert with the help of SqlBulkCopy,but first you should create a table in SQL whose scaffoldings are the same as what it is of DataTable。
Sample at:http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx
Thx
- Proposed As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Thursday, April 19, 2012 6:34 AM
- Marked As Answer by Bob Wu-MTMicrosoft Contingent Staff, Moderator Monday, April 30, 2012 3:12 AM
-
Thursday, April 19, 2012 6:40 AMModeratorHi Aashis,
How is it going with Wei_Dong’s suggestion?
If you want to more special code about how to do this, you can create a new thread in the ASP.NET Forum, but I think the idea is similar.
Best Regards,Bob Wu [MSFT]
MSDN Community Support | Feedback to us



