Burton G. Wilkins wrote:
> In ADO.Net, how might one determine whether a column in an Access table is an
> AutoNumber type?
>
> Could this be accomplished using OleDbSchemaGuid. If so could you give an
> example.
No, use this trick:
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM [" +
tableName + "] WHERE 1=0", openConnection);
DataTable tableSchema = adapter.FillSchema(new DataTable(),
SchemaType.Source);
for (int j = 0; j < tableSchema.Columns.Count; j++)
{
if(tableSchema.Columns[j].AutoIncrement)
{
// is identity
}
}
Frans
--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET:
http://www.llblgen.com
My .NET blog:
http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------