PC Review


Reply
Thread Tools Rate Thread

Dataset - Relations vb 2005

 
 
Paul Ilacqua
Guest
Posts: n/a
 
      28th Feb 2010
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

 
Reply With Quote
 
 
 
 
PvdG42
Guest
Posts: n/a
 
      28th Feb 2010

"Paul Ilacqua" <(E-Mail Removed)> wrote in message
news:CF4070C2-61A8-46A0-B202-(E-Mail Removed)...
> 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.

 
Reply With Quote
 
Paul Ilacqua
Guest
Posts: n/a
 
      28th Feb 2010
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.

"PvdG42" <(E-Mail Removed)> wrote in message
news:eNN%(E-Mail Removed)...
>
> "Paul Ilacqua" <(E-Mail Removed)> wrote in message
> news:CF4070C2-61A8-46A0-B202-(E-Mail Removed)...
>> 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.


 
Reply With Quote
 
Miro
Guest
Posts: n/a
 
      1st Mar 2010
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

"Paul Ilacqua" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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.
>
> "PvdG42" <(E-Mail Removed)> wrote in message
> news:eNN%(E-Mail Removed)...
>>
>> "Paul Ilacqua" <(E-Mail Removed)> wrote in message
>> news:CF4070C2-61A8-46A0-B202-(E-Mail Removed)...
>>> 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.

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Relations in Dataset MRW Microsoft ASP .NET 0 2nd Dec 2006 08:34 PM
Retrieve info from Dataset with Relations (Dataset,SQL or XML) Joe Microsoft C# .NET 2 4th Apr 2006 01:58 PM
One more about dataset relations Mr.Matthew.Smith@gmail.com Microsoft C# .NET 1 2nd Nov 2005 09:41 PM
DataSet Relations ronniek Microsoft ADO .NET 1 11th Sep 2003 10:41 PM
Dataset Relations rhill Microsoft ADO .NET 0 10th Jul 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:02 AM.