Code: Select all
OracleDataReader.GetSchemaTable()
it does get PK correctly.OracleDataTable.GetSchemaTable()
Has anyone experienced the same issue ?
Code: Select all
OracleDataReader.GetSchemaTable()
it does get PK correctly.OracleDataTable.GetSchemaTable()
Standard .NET Framework providers (OracleClient, ODP.NET) show the same behaviour. We will investigate this issue and notify you about the results.Alex56 wrote:I am working with Oracle 11g database from a mobile device. I noticed that when I create reader against a table on the server and get schema for that table viathe schema table never has primary key column, ["IsKey"], set to true.Code: Select all
OracleDataReader.GetSchemaTable()
Devart.Data.Oracle.OracleDataTable doesn't have public GetSchemaTable() method. Please correct your sample. Do you mean OracleDataTable.WriteXmlSchema()?Alex56 wrote:However, if I get schema on the same table viait does get PK correctly.Code: Select all
OracleDataTable.GetSchemaTable()
This is a designed behaviour. To get the primary key information, including whether a field is a part of a primary key and whether it is an AutoIncrement field, you should set the CommandBehavior.KeyInfo parameter of the OracleCommand.ExecuteReader() method when getting your data reader: http://support.microsoft.com/kb/310107. We will add this info to our documentation.OracleDataReader.GetSchemaTable()
Code: Select all
OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo);
DataTable table = reader.GetSchemaTable();
Probably you meant the OracleDataTable.SchemaTable property. OracleDataTable always requests the PK info on its opening. This explains the result you have got.OracleDataTable.GetSchemaTable()