Responses inline...
>> Hi,
>>
[quoted text clipped - 44 lines]
> relation coming from the designer-generated code? Or did he add it
> programmatically or to the DataSet in the designer?
I should have mentioned that the MembershipDataSet is generated using
CodeDom, but not by Visual Studio, so essentially the DataRelation was added
programmatically in the constructor.
>Is there a datarelation defined in the database like a foreign key? If
>there
> is a foreign key, then there is a data relation.
There are no foreign-key constraints in the source database, yet. The only
relationship is the programmatic DataRelation in the MembershipDataSet.
As I said, I should've mentioned that all the data-related types in my
solution have been generated using code that I wrote. And there lies my
concern, I've probably missed something.
BTW I'm not a glutton for punishment. The reason for creating data access
code this way is that ODP.NET and Oracle DB Lite don't work, or at least
don't work very well with the DataSet Designer in VS.
Thanks for all replies
Glenn
Bart Mermuys - 16 Jan 2007 11:56 GMT
Hi,
> Responses inline...
>
[quoted text clipped - 63 lines]
> solution have been generated using code that I wrote. And there lies my
> concern, I've probably missed something.
Yes, you should have mentioned that :-) since the problem doesn't occure
with the VS generated typed dataset , big chances are you've made some
mistake building your own typed DataSet.
It's also possible that something is wrong with your typed dataset that is
making the WinForm designer add the DataRelation another time.
A quick look at the VS generated typed DataSet did reveal some interesting
code that prevents the WinForm designer from serializing the DataRelations
(adding code inside InitializeComponent). The WinForm designer shouldn't
serialize the DataRelations since they are default ones build inside the
constructor.
public new System.Data.DataRelationCollection Relations
{
get { return base.Relations; }
}
protected override bool ShouldSerializeRelations()
{
return false;
}
But the same thing is done for DataTables though you don't mention anything
about duplicated tables...
HTH,
Greetings
> BTW I'm not a glutton for punishment. The reason for creating data access
> code this way is that ODP.NET and Oracle DB Lite don't work, or at least
[quoted text clipped - 3 lines]
>
> Glenn
Glenn - 16 Jan 2007 13:04 GMT
Bart
I hadn't overridden ShouldSerializeRelations.
As simple as that.
Many thanks
Glenn
> Hi,
>
[quoted text clipped - 102 lines]
>>
>> Glenn
Hi,
>> Hi,
>>
>>> Hi
[snipped]
>>> I realise I could do the necessary to get everything working just as I'd
>>> like it to by hand, but I'm curious as to why it tries to create the
[quoted text clipped - 10 lines]
> Customers and Orders tables from Northwind in it; you will see
> the relation between them drawn automatically.
Yes, the DataSet designer can add relations but that's not a or the problem.
But with designer i only meant the WinForm designer, the WinForm designer
shouldn't add a relations to a typed dataset.
Greetings
> My question for OP is this: is the MembershipDataSet's "baked-in"
> relation coming from the designer-generated code? Or did he add it
[quoted text clipped - 3 lines]
>
> Robin S.
RobinS - 16 Jan 2007 20:33 GMT
> Hi,
>
[quoted text clipped - 24 lines]
>
> Greetings
Gotcha. Thanks for clarifying.
Robin S.