Hi,

So I have this:

SqlDataReader rdr = ExecuteDataReader(connection, Command.Text, "Select *
from myTableName");

DataTable table = rdr.GetSchemaTable();

This is working great and telling me all the defined columns within the
myTableName, except if the column is an identity and autoincremented it is
not returning the right AutoIncrementSeed or AutoIncrementStep. Am I doing
something wrong or does GetSchemaTable() not return the AutoIncrementStep.

Or is there another way to find out what the field/column's
AutoIncrementStep, AutoIncrementSeed is?

Thanks,
Matt

Re: DataReader's GetSchemaTable Method not fully working by Robert

Robert
Mon Apr 17 09:25:48 CDT 2006

Are you specifying CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly when
you opened the reader?

Robert

"Jaffa" <Jaffa@discussions.microsoft.com> wrote in message
news:D2CDD3F3-98B0-4012-88BE-DD3273DEDC04@microsoft.com...
> Hi,
>
> So I have this:
>
> SqlDataReader rdr = ExecuteDataReader(connection, Command.Text, "Select *
> from myTableName");
>
> DataTable table = rdr.GetSchemaTable();
>
> This is working great and telling me all the defined columns within the
> myTableName, except if the column is an identity and autoincremented it is
> not returning the right AutoIncrementSeed or AutoIncrementStep. Am I doing
> something wrong or does GetSchemaTable() not return the AutoIncrementStep.
>
> Or is there another way to find out what the field/column's
> AutoIncrementStep, AutoIncrementSeed is?
>
> Thanks,
> Matt



Re: DataReader's GetSchemaTable Method not fully working by Jaffa

Jaffa
Mon Apr 17 09:33:02 CDT 2006


I have not specified both of those together I have done each individually to
get the information out. So do both need to be specified to get it to work?

Thanks,
Matt