Hi dear S/W Eng and Asp.net c# Developer.
I am facing a big problem during converting a textbox value to decimal. baceous the Database type of that variable is decimal(4,4) that is client requirement.From front end when we passing a value like 1234.0000 MSSQL throws exception "Fail to convert numeric to decimal " Pls must guide or solve this problem.
Best Re guards
Thanks in Advance

Recommended Answers

All 3 Replies

Use Decimal.TryParse() method to parse the input. Use parameterized insert/update query instead of hard-coded sql string.

decimal.TryParse() not solved my problem

try this convert.todecimal(textboxvalue.text) for decimal conversation

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.