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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:34:49+00:00 2026-05-31T06:34:49+00:00

How would i stop data repeating itself in a label? at the moment my

  • 0

How would i stop data repeating itself in a label?

at the moment my balance keep adding a value next to it for e.g balance: 500.000, 500.000

where i only want it to open once. here the code i am using

SqlDataReader readdata;

try
{

    sqlCommandbalance.Connection.Open();
    sqlCommandbalance.Parameters["@accountID"].Value = show.accountID;
    readdata = sqlCommandbalance.ExecuteReader();
    string balanceDB = null;
    string availableBalance = null;
    while (readdata.Read())
    {
        balanceDB = readdata["balance"].ToString();
        availableBalance = (Convert.ToDecimal(readdata["balance"].ToString()) + Convert.ToDecimal(readdata["overdraftlimit"])).ToString();
    }
    sqlCommandbalance.Connection.Close();
    balanceShow.Text += " " + balanceDB.ToString();
    availablebalanceShow.Text += " " + availableBalance.ToString();
  • 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-05-31T06:34:51+00:00Added an answer on May 31, 2026 at 6:34 am

    you need to change this:

    balanceShow.Text += " " + balanceDB.ToString();
    availablebalanceShow.Text += " " + availableBalance.ToString();
    

    to

    balanceShow.Text = " " + balanceDB.ToString();
    availablebalanceShow.Text = " " + availableBalance.ToString();
    

    the += is equivalent to saying this:

    balanceShow.Text = balanceShow.Text + " " + balanceDB.ToString();
    

    which is why it is always appending the text to the existing text. You want to just assign the value of balance to the Text property.

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

Sidebar

Related Questions

I would like to stop power users from deleting data using SQL Server Management
is there any danger if the rails html_escape function would stop escaping '&'? I
I would like to stop images from loading, as in not even get a
I have a search page where I would like to stop the user entering
and I would like to know if there is any way to stop a
The endless adapter that I've used in my code, doesn't stop expecting data even
I have come to the point where I need to stop storing my data
What algorithm would you use to create an application that given appropriate data (list
What’s the equivalent of S#arp architecture (.net) in the java world. A one stop
Would it not make sense to support a set of languages (Java, Python, Ruby,

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.