Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vb.net 2008 Datagridview update Database questions

Status
Not open for further replies.

rw409168

Programmer
Jul 16, 2009
95
GB
Greetings,

This is quite a broad question so I will do my best to descibe the scenerio clearly and accurately.

A datagridview has a datasource of type dataset, the dataset is created in a seperate class where all the database functionality takes place, returning the dataset.

The dataset contains data from TWO tables ("user" and "bookings") as infromation is required to be seen by the user within the datagridview.

The datagridview when adding new rows need to update the table "bookings".

Should I add the data via direct SQL command insertion specifying SQL and Connection?

The alternative is using a dataAdapter to update the dataset isn't it?

What confuses me here is my dataset doesn't directly map onto the "bookings" table as some extra columns are from another table and other values are calculated from variables at runtime.

I hope this makes sense and just need some general guidance, my experiencs of datagridview is very slim and well I'm finding it a real pain at the moment.

Thanks
Rob
 
I would use the DataAdapter, but create my own Insert and Update Commands for use by the DataAdapter to insert and update just the data you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top