It seems that SqliteDataReader.GetSchemaTable() doesn't return any key
information ("IsKey","IsUnique", ...) in MonoTouch, while it does in Mono.
The source code for GetSchemaTable contains the following:
#if !MONOTOUCH
strColumn =
_command.Connection._sql.ColumnOriginalName(_activeStatement, n);
if (String.IsNullOrEmpty(strColumn) == false)
row[SchemaTableColumn.BaseColumnName] = strColumn;
row[SchemaTableColumn.IsExpression] =
String.IsNullOrEmpty(strColumn);
row[SchemaTableColumn.IsAliased] = (String.Compare(GetName(n),
strColumn, true, CultureInfo.InvariantCulture) != 0);
temp = _command.Connection._sql.ColumnTableName(_activeStatement,
n);
if (String.IsNullOrEmpty(temp) == false)
row[SchemaTableColumn.BaseTableName] = temp;
temp = _command.Connection._sql.ColumnDatabaseName(_activeStatement,
n);
if (String.IsNullOrEmpty(temp) == false)
row[SchemaTableOptionalColumn.BaseCatalogName] = temp;
#endif
string dataType = null;
// If we have a table-bound column, extract the extra information
from it
if (String.IsNullOrEmpty(strColumn) == false)
{
// Determine key information....
}
So it seems the code for determining the key information is explicitly
removed for MonoTouch. Why is that? Is there any other way except by
querying "pragma table_info()" ?
--
View this message in context:
http://monotouch.2284126.n4.nabble.com/Key-information-not-returned-in-GetSchemaTable-tp4649539.html
Sent from the MonoTouch mailing list archive at Nabble.com._______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch