Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9190251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:25:08+00:00 2026-06-17T20:25:08+00:00

I have Textbox which takes decimal values. I have written Keypress event to enter

  • 0

I have Textbox which takes decimal values. I have written Keypress event to enter decimal numbers. But when I am trying to convert the value in the textbox to Decimal format to store in database, it is only converting it to Integer.

I am trying to convert text to decimal as follows:

dr["Total Amount"] = Decimal.Parse(txtTotalAmount.Text.ToString());

well I am using the above code with the datagridview.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:25:10+00:00Added an answer on June 17, 2026 at 8:25 pm

    Kindly check your DataType of Total Amount in your table. if you are using SQL Server and want to store decimal value then you have to use money or decimal according to your need.
    Note: DECIMAL(2,2) and DECIMAL(2,4) are different data types. This means that 11.22 and 11.2222

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Desktop window application. I have textbox in which user give values in numbers. what
I have a varible sem,which takes inputfrom the textbox but if the textbox is
I have my own textbox which inherits System.Windows.Forms.TextBox I am trying to display texts
I have a method which takes a hex value and assign it as a
I have a project where a user can enter a decimal in a textbox.
I have some jquery that takes the value of a textbox, inserts it into
I have a textbox which takes input for an answer to a security question.
I have a TextBox which i use to store a url to applied a
i have a textbox which is filled with date from a datepicker(calendar is accessed
I have a textbox which is binded to a specific database table column. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.