Dataset - Relations vb 2005

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
 
P

PvdG42

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.
 
P

Paul Ilacqua

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.
 
M

Miro

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top