Solved

Gridview to Database

Posted on 2012-03-21
6
280 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

708 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

17 Experts available now in Live!

Get 1:1 Help Now