Solved

Gridview to Database

Posted on 2012-03-21
6
297 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
[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
6 Comments
 
LVL 34

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
Independent Software Vendors: 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!

 

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 34

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

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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 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…

710 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