table relationships

Discussion in 'ASP .Net Datagrid Control' started by et, Dec 28, 2004.

  1. et

    et Guest

    How do I programmtically get the relationships of a table??

    I can get the list of columns:
    dtFields = conn.GetOleDbSchemaTable(OleDbSchemaGuid., New Object() {Nothing,
    Nothing, strTableName, Nothing"})

    , but when I change it to Foreign_Keys, no data is returned.

    dtFields = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Foreign_Keys, New
    Object() {Nothing, Nothing, strTableName, Nothing})
    et, Dec 28, 2004
    #1
    1. Advertising

  2. et

    Jason Guest

    ET,
    What database are you using? If it's SQL, try accessing the system
    tables for getting at this information.

    http://www.microsoft.com/sql/techinfo/productdoc/2000/systables.asp

    Jason

    et wrote:
    > How do I programmtically get the relationships of a table??
    >
    > I can get the list of columns:
    > dtFields = conn.GetOleDbSchemaTable(OleDbSchemaGuid., New Object()

    {Nothing,
    > Nothing, strTableName, Nothing"})
    >
    > , but when I change it to Foreign_Keys, no data is returned.
    >
    > dtFields = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Foreign_Keys, New
    > Object() {Nothing, Nothing, strTableName, Nothing})
    Jason, Dec 28, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    0
    Views:
    688
    Steve
    Feb 29, 2004
  2. =?Utf-8?B?T3plcg==?=

    2 tables and 2 relationships in a datagrid

    =?Utf-8?B?T3plcg==?=, Jun 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    315
    Craig Deelsnyder
    Jun 14, 2004
  3. Darren Clark

    accessing typed dataset relationships?

    Darren Clark, Jun 17, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,426
    Darren Clark
    Jun 17, 2004
  4. cvchen
    Replies:
    1
    Views:
    351
    Cy Edmunds
    Oct 29, 2003
  5. John

    table relationships

    John, Mar 8, 2005, in forum: ASP General
    Replies:
    2
    Views:
    101
Loading...

Share This Page