{"Operator '=' is not defined for type 'DBNull' and type 'Double'."}
when a user inputs a value into a text box, i am searching that value in my dataset. although the number that i entered is in my dataset, i am getting this excemption.
please help me
I am guessing that your dataset as a column that classifies itself as "double", and also allows Nulls in that column.
I am not sure how you are searching, but you would need to handle the case when the value in the dataset is null (Nothing)/DBNull
A Double cannot be compared to DBNull because the "=" operator has not been implemented to make this comparison. Since you cannot override operators in VB.NET you cannot compare Doubles to DBNull values.
Make sure the value you are retrieving from your DataSet is not DBNull before comparing the Double to that value If you don't, be prepared to handle the Exception thrown.
Comment