I wrote a class representing Product Model <ProductInfo.cs>, in which it contains this line in the constructor:
...
this._unitPrice = (values[6]==DBNull.Value)?0
float)values[6]; // ***
...
Then, i wrote this piece of code:
Product bll = new Product(); // get the Business Logic Layer
ProductInfo productDetails = bll.getProductByID(ProductID);
Then this error come out:
Exception Details: System.InvalidCastException: Specified cast is not valid.
And the source error pointed to *** line.
Can anyone tell me what should I do? Thanks in advance
...
this._unitPrice = (values[6]==DBNull.Value)?0
...
Then, i wrote this piece of code:
Product bll = new Product(); // get the Business Logic Layer
ProductInfo productDetails = bll.getProductByID(ProductID);
Then this error come out:
Exception Details: System.InvalidCastException: Specified cast is not valid.
And the source error pointed to *** line.
Can anyone tell me what should I do? Thanks in advance