Solved

Gridview to Database

Posted on 2012-03-21
6
301 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

617 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