2
Answers

how do i deal with float

Ask a question
mali

mali

15y
3.8k
1

this is my code:

found_product[i] = new Product((int)(dr["productNum"]), (string)(dr["catalogNum"]), (string)(dr["item_Description"]), (string)(dr["productDescription"]), (int)(dr["productAmount"]),(string)(dr["supplier_name"]), (string)(dr["date"]).ToString(), (float)(dr["buyingPrice"]));

I have a problem with the "(float)(dr["buyingPrice"])" it's give me an error "Specified cast is not valid."

what can I do?


Answers (2)