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

  • SEARCH
  • Home
  • 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 119777
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:42:24+00:00 2026-05-11T03:42:24+00:00

Originaly posted a while back on a different forum, hope I can find a

  • 0

Originaly posted a while back on a different forum, hope I can find a bit more help here 🙂

Hi Guys,

I’m sure this is a pretty basic question, but I’m new to much programming and C#. I find I need to clear databindings on several controls and currently have:

            lblTableValue1.DataBindings.Clear();             lblTableValue2.DataBindings.Clear();             lblTableValue3.DataBindings.Clear();             lblTableValue4.DataBindings.Clear();             lblTableValue5.DataBindings.Clear();             lblTableValue6.DataBindings.Clear();             lblTableValue7.DataBindings.Clear(); 

This can’t be the best way of doing this can it? I also need to set all these text values to ”, can I group them in someway and call clear on the whole group?

Many Thanks in advance G

  • 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. 2026-05-11T03:42:24+00:00Added an answer on May 11, 2026 at 3:42 am
    foreach(Control c in this.Controls) {     if(c.Name.StartsWith('lblTableValue'))     {         c.DataBindings.Clear();     } } 

    That might do the job. Or if you’re more of a purist:

    foreach(Control c in new Control[]     {         lblTableValue1,         lblTableValue2,         etc     }) {     c.DataBindings.Clear(); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to expand a question I posted a while ago : I'm querying
I have a user complaining about frequent timeouts in my Intranet web page. While
First of all: A quite similar problem has been posted and somehow solved already,
Hopefully more of a What am I doing wrong? than How do I? but
I originally posted a much simpler (and less helpful) question, and have edited this
I just upgraded to the beta 2 of Crystal Reports for Visual Studio 2010
If I run the classical bash forkbomb: :(){ :&:&};: my system hangs after a
Possible Duplicate: Making an undefined class as friend, and defining it later. I have
Update So in my Original question I was just frustrated because I was being
Greetings all, I realize this issue has been posed before in other forms, and

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.