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
Solved

Gridview to Database

Posted on 2012-03-21
6
292 Views
Last Modified: 2012-03-24
Hi,

I am using VB.net and i have a datagridview which has data in it.

The columns of the datagridview  were created at design time and the data was entered it to it by hand after starting the application.

I need a vb.net code that can put those data in a database.

Thanks in advance.
0
Comment
Question by:baabaa_nl
6 Comments
 
LVL 33

Expert Comment

by:Norie
ID: 37746974
Do you have an existing table with the same fields as the gridview in the database?
0
 
LVL 17

Expert Comment

by:nepaluz
ID: 37747002
in addition to the above clarification what database are you trying to save the gridview data to: SQL, SQLCE, Acces, MySQL .....?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 37747051
are the columns of your gridview related to an existing table in your database?

you can use a Command (oledb in your case) with an INSERT query. check http://msdn.microsoft.com/en-us/library/aa302325.aspx
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:baabaa_nl
ID: 37747421
Hi guys,


I am using an access 2007 database and my grid view has 5 columns.

I do have a table in the database which has similar fields and names.

But i only need a selected 4 columns to go into a table. and another set of four columsn of data into another table.

The reason is because i a was displaying two sets of queries on the same gridview at the same time(i.e. after one query fills the gridview, the next query fills the data below it.)


Hi Emoreau: I am also going through the link that you gave me on the comment above.


Thanks in advance.
0
 
LVL 33

Expert Comment

by:Norie
ID: 37747464
Couldn't you use 2 gridviews?
0
 

Author Comment

by:baabaa_nl
ID: 37748114
Hi imnorie,

The reason i had to use a single gird view was the client needed two set of data into one girdview.


And about my above comment i mentioned that i only need only a set of four columns out of five columns to be stored in my database table.

But thats not necessary. i need the complete gridview data to go into a database table, were the table has similar fields as the gridview columns and names.

Thanks in advance.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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