GetOleDbSchemaTable Foreign Keys on Sql Server 2005

Posted by haxelit on Stack Overflow See other posts from Stack Overflow or by haxelit
Published on 2010-02-15T23:57:51Z Indexed on 2010/04/06 22:03 UTC
Read the original article Hit count: 351

Filed under:
|
|
|
|

I'm trying to get the Foreign Keys for a table in my SQL Server 2005 database. I'm using the GetOleDbSchemaTable function right now:

DataTable schemaTable = connection.GetOleDbSchemaTable(
        OleDbSchemaGuid.Foreign_Keys,
        new object[] { null, null, null, "TABLE" });

This pulls back the right foreign keys, the only problem is that the UpdateRule and DeleteRule are set to "No Action". If I browse to the same table in SSMS I can see that my DeleteRule is "Set NULL". Does the GetOleDbSchemaTable function not return the proper foreign key rules ? Has any one else ran into this problem ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about oledb