C
Christoph Boget
I am getting an error (a few among many) for the
following lines of code:
retval[curRowNum].BrokerName = (( curRow["BrokerName"] ==
System.DBNull.Value ) ? SqlString.Null : (string)curRow["BrokerName"] );
retval[curRowNum].BrokerGroupId = (( curRow["BrokerGroupId"] ==
System.DBNull.Value ) ? SqlInt32.Null : (int)curRow["BrokerGroupId"] );
The errors are (in turn):
"Cannot implicitly convert type 'System.Data.SqlTypes.SqlString' to
'string'"
"Cannot implicitly convert type 'System.Data.SqlTypes.SqlInt32' to 'int'"
So I'm curious, where is it getting the idea that I am
*implicitly* tyring to convert the type? When it is very
apparent that I am *explicitly* trying to convert it. I've
done some searches on Google but couldn't come up
with an appropriate answer. I'm hoping you'll be able
to tell me what's going on.
thnx,
Christoph
following lines of code:
retval[curRowNum].BrokerName = (( curRow["BrokerName"] ==
System.DBNull.Value ) ? SqlString.Null : (string)curRow["BrokerName"] );
retval[curRowNum].BrokerGroupId = (( curRow["BrokerGroupId"] ==
System.DBNull.Value ) ? SqlInt32.Null : (int)curRow["BrokerGroupId"] );
The errors are (in turn):
"Cannot implicitly convert type 'System.Data.SqlTypes.SqlString' to
'string'"
"Cannot implicitly convert type 'System.Data.SqlTypes.SqlInt32' to 'int'"
So I'm curious, where is it getting the idea that I am
*implicitly* tyring to convert the type? When it is very
apparent that I am *explicitly* trying to convert it. I've
done some searches on Google but couldn't come up
with an appropriate answer. I'm hoping you'll be able
to tell me what's going on.
thnx,
Christoph