PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Re: Getting ParentRelations for a DataTable using FillSchema

Reply

Re: Getting ParentRelations for a DataTable using FillSchema

 
Thread Tools Rate Thread
Old 29-06-2003, 04:05 AM   #1
Kathleen Dollard
Guest
 
Posts: n/a
Default Re: Getting ParentRelations for a DataTable using FillSchema


If your using a SQL-92 compliant back end, you can use the Information
Schemas. If you are using SQL Server (or Oracle, and probably others), let
me know if you need more information on this approach.

Kathleen

"Roy Osherove" <fireride@netvision.net.il> wrote in message
news:bdk76c$oqs$1@news2.netvision.net.il...
> Hi all.
> I'm facing the following problem:
>
> Given a DataTable, I need to know all the Other DataTables that have a
> Relation to this table. Specifically, I want to know all the relations in
> which this table is a "Details" table (i.e. has a foreign key constraint).
>
> I've tried using the DataAdapter.FillSchema method, but no luck.
> I've also tries setting the DataAdapter.MissingSchemaAction to AddWithKey,
> but still no luck.
> I've made sure that the table actually has a foreign key in the DB(I'm

using
> Northwind SQL server).
>
> The only way that works, is by using a completely different feature:
> Connection.GetOleDBSchemaTable(), but It seems to me that this shouldn't

be
> possible using the DataAdapter as well.
>
> Has anyone used this method successfully?
>
>



  Reply With Quote
Old 29-06-2003, 06:38 AM   #2
Roy Osherove
Guest
 
Posts: n/a
Default Re: Getting ParentRelations for a DataTable using FillSchema



I'm not sure i understand. Could you please elaborate? I'm using SQL
server 2000.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off