[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

datagridview to database

Posted on 2012-03-21
2
Medium Priority
?
302 Views
Last Modified: 2012-03-23
Hi guys,

I am using a datagridview on a windows form and i have added the columns using the properties window.

After executing the application i entered the data manually.

The datagridview has 5 columns which was created at design time.

Then the data in the columns were just typed manually by hand.

Now i need to send those data into a database. So this is the code that i need.

I am using Vb.net and access 2007 database.

Thanks in advance.
0
Comment
Question by:baabaa_nl
2 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 2000 total points
ID: 37749450
You need to loop through the rows of your datagrid.

for each row, you will need to write an insert statement to add the row to the database.

see http://msdn.microsoft.com/en-us/library/ms971485.aspx and http://www.vbforums.com/showthread.php?t=511090
0
 

Author Comment

by:baabaa_nl
ID: 37753393
I couldn't find any code getting the gridview data to the database.

Could you please give me the code for that.


Also if possible please give the code to export the data from the gridview to a datatable and then from the datatable to a database.

Thanks in advance.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question