Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Sir
I want to insert multiple record at a time in Sql server 2008 r2.
Posted
Comments
Sergey Alexandrovich Kryukov 2-May-12 13:55pm    
Not a question. What's the problem?
What is it, Forms? Something else? Tag it.
--SA
Sandeep Mewara 3-May-12 2:46am    
And the issue is? This is not a well framed question! We cannot work out what you are trying to do/ask from the post. Please elaborate and be specific.
Use the "Improve question" link to edit your question and provide better information.

1 solution

One of the options is to create a Strongly Typed DataSet using the AddNewDataSource wizard of VisualStudio. This wizard generates the DataSet and DataTables corresponding to the Tables in the MS SQL Server. It also creates TableAdapter for each of the Table for filling the data and updating all the rows of the DataTable to the corresponding Table in MS SQL Server.

Connecting to Data is explained here
Connecting to Data in Visual Studio Overview [^]
Data Source Configuration Wizard[^]

One problem with this approach is that for filling the data into the DataTable and saving the data from the DataTable to the database the TableAdapter corresponding to the DataTable is to be used as the DataTables and TableAdapters are strongly typed.

However, using reflection a common class can be written to handle the filling and saving data for all or some DataTables. Such class is given in this CodeProject article
General purpose class to fill DataTable(s) from DataBase and to save DataTable(s) to DataBase using reflection[^]

Binding the data to DataGridView is explained here
How to: Bind Data to the Windows Forms DataGridView Control Using the Designer [^]

I think it may be helpful.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900