You are using a strongly typed data row which is useful in most cases but it does mean you can't compare its values with DBNull. However, you should be able to get at the underlying objects with the indexer on your row:
You may need to add some logic to be able to handle an unexpected null value in your data.
From dataReader you can use, but you cannot give the column name here, you have to use column ordinal.
If (oReader.IsDbnull(0))
//Your code.
Adnan
ASKER
oki, i thinnk it is some problom with my Datasat: DsOperatorAccess.OperatorRow drUser = dsOperatorAccess1.Operator.FindByOperator_ID(intUserId);
When i debug and check the columns in my datarow drUser i get this message on the column WinAuth = 'drUser.WinAuth' threw an exception of type 'System.Data.StrongTypingException'
and InnerException = {"Specified cast is not valid."}
Open in new window