Solved

Gridview to Database

Posted on 2012-03-21
6
285 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 69

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

914 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now