Dataset - Relations vb 2005

  • Thread starter Thread starter Paul Ilacqua
  • Start date Start date
P

Paul Ilacqua

I'm using VB 2005....
I programmatically create a Dataset(), fill it (Via a data adapter)
with 3 tables from a SQL Server 2008 database that already has the
relationships' and Foreign keys defined. Do I need to recreate them in the
dataset?
I'd like to maintain my relationships in the SQL Server, so I do not
have a point of failure maintaining relations in my dataset.
Thanks
Paul
 
Paul Ilacqua said:
I'm using VB 2005....
I programmatically create a Dataset(), fill it (Via a data adapter)
with 3 tables from a SQL Server 2008 database that already has the
relationships' and Foreign keys defined. Do I need to recreate them in the
dataset?
I'd like to maintain my relationships in the SQL Server, so I do not
have a point of failure maintaining relations in my dataset.
Thanks
Paul

In a word, yes.
 
I Tested it with and without relations in my VB code. Without it "allows"
foreign key violations, and with it it raises an error. Is it an argument,
of the dataset, table ?
Thanks for the response.
 
I belevie that having it setup in a dataset provides an error trap on the
client side before the push to the datafile.

After, once you push to the datafile (sql file) then this will push the
error back to the client back.

So you save yourself the round trip.

Here is an example:
Lets say you have a parent child table. The relationship is setup and a
child requires a parent record.

However, if you make a dataset with just the child table record, try to
delete a record - it will let you.
That is - until you try to push the data back to the datafile. Then you
will get an error.

Miro
 
Back
Top