Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

datagridview to database

Posted on 2012-03-21
2
Medium Priority
?
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

636 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