Skip to content
Advertisement

I get an error “Error converting data type nvarchar to real.”

The code which I have is below, can you please inform me where the issue might be so we can drop the price by warehouse ID with 7%?

Advertisement

Answer

As you are not assigning any value to @Price in the C# code while your Warehouse Id and the Discount rate are subject to be assigned by the end-user, I recommend your code be like this:

I would also recommend you think again about your query as it will update all products price with the same value, you may consider passing parameter @ProductId and your query be

sure that was for example.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement