By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

A bug in SqlDataReader.GetSchemaTable() ?

P: n/a

I'm using the SqlServer managed provider from the framework (SqlClient) to communicate with SqlServer.
I have the following table in the database:
create table t1(f1 int)
I already have an instance of SqlCommand (slqCommand) setup with the correct connectionstring and have the following peace of code:
sqlCommand.CommandText = "select * from t1";
SqlDataReader reader = sqlCommand.ExecuteReader( CommandBehavior.KeyInfo );
DataRow[] infoRows = reader.GetSchemaTable().Select();
Console.Write("\n" + infoRows[0].IsNull("NumericScale"));
Console.Write("\n" + infoRows[0]["NumericScale"]);
It gives me the output :
But the documentation says:
NumericScale: If ProviderType is is DBTYPE_DECIMAL or DBTYPE_NUMERIC, the number of digits to the right of the decimal point. Otherwise, this is a null value.
- so i figure that this must be a bug (?), or what am I doing wrong?
By the way same thing happens when "f1" is of type e.g. "text".

Morten Overgaard Hansen
Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.