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 8828405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:35:58+00:00 2026-06-14T07:35:58+00:00

I have a problem with decimal parse, I know this question been asked a

  • 0

I have a problem with decimal parse, I know this question been asked a loot, but none of the solution worked for me, and i’ve been stuck in here for two days now.

My problem is my CultureInfo is set to fr_Fr and when i put the code below an error shows caused with comma that separates decimal instead of period.

double entree = Convert.ToDouble(row["entree"]);
double sortie = Convert.ToDouble(row["sortie"]);
int id_mw = Convert.ToInt32(row["mouvment_w_id"]);

qte_Stock += entree - sortie;
decimal qte_s ;

MessageBox.Show("" + CultureInfo.CurrentCulture);
qte_s = Decimal.Parse(Convert.ToString(qte_Stock), NumberStyles.Number ^ NumberStyles.AllowThousands);

MessageBox.Show("" + qte_s);
qte.CommandText = "Update tcpos.dbo.Warehouse_mouvement set qte_stock= " + qte_s + " where mouvment_w_id = "+id_mw;
qte.ExecuteNonQuery();
  • 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-14T07:35:59+00:00Added an answer on June 14, 2026 at 7:35 am

    What’s the type of qte_Stock

    …

    it was a decimal

    …

    Then you have your answer since you want to make it a decimal.

    Pass the decimal as Parameter to prevent sql-injection and this issue(decimal separator).

    For example(assuming SQL-Server as rdbms):

    using(var con = new SqlConnection(connectionString))
    using(var cmd = new SqlCommand("Update tcpos.dbo.Warehouse_mouvement set qte_stock=@qte_stock where mouvment_w_id = @mouvment_w_id", con))
    {
        cmd.Parameters.AddWithValue("@qte_stock", qte_stock);
        cmd.Parameters.AddWithValue("@mouvment_w_id", id_mw);
        con.Open();
        cmd.ExecuteNonQuery();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem converting a string binary to a decimal I was using
I have a textbox that gets a decimal value say 10500.00 the problem is
I have problem with my query on C, I’m using the oci8 driver. This
I have problem SIMILAR to preventing form data reposting, but not quite the same
Guys, I have a string that contains a decimal number. The problem is, sometimes
I have a problem with conversion from double to decimal: public class CartesianCoordinates {
I have a problem, i didn't found yet the solution so i am asking
I have this problem: A positive integer is called a palindrome if its representation
I have problem in generating or getting decimal value in python. for now, I
I have a problem with assigning one big decimal value to another I am

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.