DataReader's GetSchemaTable Method not fully working

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Are you specifying CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly when
you opened the reader?

Robert
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top