PC Review


Reply
Thread Tools Rate Thread

A bug in SqlDataReader.GetSchemaTable() ?

 
 
=?Utf-8?B?TW9ydGVuIE92ZXJnYWFyZCBIYW5zZW4=?=
Guest
Posts: n/a
 
      21st Jan 2004
Hi,

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();
reader.Close();
Console.Write("\n" + infoRows[0].IsNull("NumericScale"));
Console.Write("\n" + infoRows[0]["NumericScale"]);
---------------------------
It gives me the output :
False
255
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SqlDataReader.GetSchemaTable returns too many columns John Microsoft ADO .NET 6 7th Oct 2006 03:59 AM
SqlDataReader .NET 2.0 GetSchemaTable not returning AutoIncrementS =?Utf-8?B?SmFmZmE=?= Microsoft ADO .NET 4 17th Apr 2006 09:41 PM
ADO.Net 2.0 ; SqlDataReader.GetSchemaTable broken? ajj3085@alum.rit.edu Microsoft ADO .NET 4 8th Mar 2006 03:46 PM
sqlDataReader.GetSchemaTable =?Utf-8?B?Z3V5?= Microsoft Dot NET 0 15th Dec 2005 03:51 PM
A bug in SqlDataReader.GetSchemaTable() ? Morten Overgaard Hansen Microsoft Dot NET Framework 0 21st Jan 2004 10:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:17 AM.