GetSchema() PrimaryKeys Collection does not exits

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
pedro.castelo
Posts: 4
Joined: Tue 24 Jun 2008 12:31

GetSchema() PrimaryKeys Collection does not exits

Post by pedro.castelo » Tue 24 Jun 2008 12:48

Hi!

I'm evaluating OraDirect.Net product but I got surprised when I did not find the PrimaryKeys Collection from GetSchema() method. The most Curious thing is that the Microsoft Native Oracle Provider has it. In the following lines you can see their differences...

=========================================
CoreLab.Oracle.OracleConnection
=========================================
MetaDataCollections
Restrictions
ReservedWords
Users
Tables
Views
Columns
Indexes
IndexColumns
Functions
Procedures
Arguments
Synonyms
Sequences
Packages
PackageBodies
ForeignKeys
ForeignKeyColumns
Triggers
Clusters
QueuePublishers
Queues
QueueTables

=========================================
System.Data.OracleClient.OracleConnection
=========================================
MetaDataCollections
DataSourceInformation
DataTypes
Restrictions
ReservedWords
Users
Tables
Columns
Views
Synonyms
Sequences
ProcedureParameters
Functions
IndexColumns
Indexes
Packages
PackageBodies
Arguments
Procedures
UniqueKeys
PrimaryKeys << I Need this one
ForeignKeys
ForeignKeyColumns

Rather than the current GetSchema return collections, I really need this PrimaryKeys Collection. And unfortunatelly, In my case, I cannot assume Unique Index as PrimaryKeys.

Can you help me? Is there any way to get this PrimaryKeys Collection?

Kind regards,

Pedro Castelo Branco Lourenço
Innovation Manager
Savcor Forest Ltda
Tel. +55 12 3946 2609
Cel. +55 12 8158 5338



“Things should be as simple as possible, but not simpler.” Albert Einstein

anton.connect
Posts: 43
Joined: Thu 19 Jun 2008 14:30

Post by anton.connect » Tue 24 Jun 2008 15:18

Primary Keys collection has not been implemented in OracleConnection yet. We are working on this issue now. Alternatively, you can get PrimaryKeys in the following way:

OracleCommand selCom = new OracleCommand("select * from dept");
OracleDataTable dt = new OracleDataTable(selCom, connection);
dt.Active = true;
DataColumn[] dc = dt.PrimaryKey;

Post Reply