DataGridView / who to update tables with FKs

  • Thread starter Thread starter Christopher Schlüter
  • Start date Start date
C

Christopher Schlüter

Hello,

i'm using VB.net 2008 Express with SQL Server 2008 SP1.
I'm trying to create a winfows app.

I use a DataGridView to display colums from several joined tables. (using
dataset, datatable und datadadapter)
How can i update the data in the DB? The update method can't be created by
the tableadapter when using inner joins.

Is there a best practice how to display and update normalized DB tables?

Thx

Chris
 
I use a DataGridView to display colums from several joined tables.
(using dataset, datatable und datadadapter)
How can i update the data in the DB? The update method can't be
created by the tableadapter when using inner joins.

Is there a best practice how to display and update normalized DB
tables?


Create queries and/or stored procedures to call for the update and call
these queries instead of trying to use the Update() method. For any
insert, you will have to insert parent tables first, or it will blow due
to not respecting constraints.

I love the drag and drop in Visual Studio, but there are times when you
get past the point where the autogenerated Update() will work for you.
At those points in time, add additional queries to the TableAdapter and
use them to Update.

If you have never added custom queries to a TableAdapter, this will be
an eye opening exercise in just how flexible the adapter can be (if you
are going to continue to use DataSets, that is).

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top