"Neeraj" <kn*******@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
Hi all.
I have stuck at a strange point.in Database some master table have
identity column and some havenot. Then How can i know at runtimes that
which table have identity column.
According to this i have to write query string.
I got dataset from table.
and
write
ds.Tables[0].Columns[0].AutoIncrement
which always gives false.
If youmhave any idea please share with me
Thanks
Neeraj
Quite a few people see this property as what you thought, an identity field
in the database. What they don't see clearly is that the property means to
auto-increment for the DataRow being added to the DataTable (not for the
dbms, but for the .Net DataTable).
What type of database are you using? If SQL Server, then you can use the
stored procedure sp_columns to return a dataset/table that contains all of
the column definitions (including whether they are an identity field).
HTH,
Mythran