I am trying to use this type as a container for a database value from
a DataReader until I can get it into a DataSet.
In the following line of code, I am trying to detect NULL and insert
NULL or the DataReader value into my variable :
MyNumericPrecision=aRdr["Numeric_Precision"]==System.DBNull.Value?System.Data.SqlTypes.SqlInt3 2.Null:(System.Data.SqlTypes.SqlInt32)aRdr["Numeric_Precision"];
My variable is declared at the top of my class as follows:
private System.Data.SqlTypes.SqlInt32 MyNumericPrecision=new
System.Data.SqlTypes.SqlInt32(0);
My DataReader is populated as follows :
"Select Convert(int,Character_Maximum_Length) as
Character_Maximum_Length," +
"Convert(int,Numeric_Precision) as
Numeric_Precision," +
"Convert(int,Numeric_Scale) as Numeric_Scale" +
" From Information_Schema.Columns" +
" Where Column_name=@ColName and
Table_Name=@TableName"
What am I doing wrong?
Brian