PC Review


Reply
Thread Tools Rate Thread

Converting Untyped Datasets into Strongly Typed Datasets with Foreign Key Constraints.

 
 
Alex Berryhill
Guest
Posts: n/a
 
      18th Mar 2004
Hi all,

This might seem naive, but been spending quite a bit of time on this;
was wondering if anyone could help me out here.

My problem is as follows:- I have an (MS Data Access Applications
Blocks-generated) untyped dataset that has data grabbed from the
database. I need to convert it into (an already defined) strongly
typed dataset, but one with a foreign key constraint enabled in it
(that is, it has two tables). Any simple way of doing this?

I had, previously, done that for single-table-datasets by declaring
the table name (of the untyped dataset) to be the same as that of its
strongly typed equivalent, and then doing a Merge() for both. I,
obviously, can't do the same thing over here, mainly because of the,
you guessed it, foreign key constraint.

Any help on this would be deeply appreciated.

TIA!
Alex B.
 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      18th Mar 2004
Hi Alex,

"Alex Berryhill" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi all,
>
> This might seem naive, but been spending quite a bit of time on this;
> was wondering if anyone could help me out here.
>
> My problem is as follows:- I have an (MS Data Access Applications
> Blocks-generated) untyped dataset that has data grabbed from the
> database. I need to convert it into (an already defined) strongly
> typed dataset, but one with a foreign key constraint enabled in it
> (that is, it has two tables). Any simple way of doing this?
>
> I had, previously, done that for single-table-datasets by declaring
> the table name (of the untyped dataset) to be the same as that of its
> strongly typed equivalent, and then doing a Merge() for both. I,
> obviously, can't do the same thing over here, mainly because of the,
> you guessed it, foreign key constraint.


Why not?
I mean if you want to have a relation between table it won't let you have
"bad" data because relation enforces consistency.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com


 
Reply With Quote
 
Alex Berryhill
Guest
Posts: n/a
 
      19th Mar 2004
> Why not?
> I mean if you want to have a relation between table it won't let you have
> "bad" data because relation enforces consistency.


What I meant to say was that I was getting an error if I did that.

Fixed it now; all I needed to do was to turn .EnforceConstraints to
false before doing a .Merge()

Thanks anyway for your response!
 
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
what is meant by typed/untyped/strongly typed datasets? Rachana Microsoft VB .NET 4 14th Nov 2007 07:11 PM
What is typed/untyped datasets ? Rachana Microsoft Dot NET 1 14th Nov 2007 03:24 PM
Typed and Untyped Datasets Roshawn Microsoft ADO .NET 1 18th Nov 2003 08:55 AM
Converting Strongly Typed Datasets David Microsoft Dot NET 1 30th Oct 2003 08:01 PM
Re: typed and untyped datasets Fergus Cooney Microsoft VB .NET 0 4th Sep 2003 03:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:44 AM.