Querystring Datatable Schema to Get Foreign Key Constraint

J

Jason Butera

I have a datatable in a dataset that contains columns that are Foreign
Keys to other tables that are not returned in the dataset. Is there a
way I can query a column of a datatable and know that the entry is a
Foreign Key (a primary key in another table). If so, can I get that
other table's name?

Thanks,

Jason
 
R

Roy Osherove

I have a datatable in a dataset that contains columns that are Foreign
Keys to other tables that are not returned in the dataset. Is there a
way I can query a column of a datatable and know that the entry is a
Foreign Key (a primary key in another table). If so, can I get that
other table's name?

Thanks,

Jason

I've written a schemaHelper class that does exactly that:
it will bring back a dataset with tables *and* relations between them
automatically. check it out:
http://weblogs.asp.net/rosherove/story/9661.aspx
 

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