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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:52:34+00:00 2026-05-20T15:52:34+00:00

I want to wire a text box to a BindingSource . I tried this:

  • 0

I want to wire a text box to a BindingSource. I tried this:

            SqlDataAdapter da = new SqlDataAdapter("select col1, col2, from table1", conn);
            DataSet dt = new DataSet();
            da.Fill(dt);

            bindingSource1.DataSource = dt;

            textBox2.DataBindings.Add("Text", bindingSource1, "col1");

When I run it, it says this:
Cannot bind to the property or column col1 on the DataSource.
What am I doing wrong?

  • 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-20T15:52:34+00:00Added an answer on May 20, 2026 at 3:52 pm

    Try something like this:

    BindingSource _bs;
    
    
    private void Form1_Load(object sender, System.EventArgs e) {
        //  Creamos el objeto BindingSource
        _bs = new BindingSource();
        //  Establecemos la conexi?n para recuperar los datos
        //  de los Clientes.
        // 
        SqlConnection cnn = new SqlConnection("Data Source=(local);");
        string sql = "SELECT * FROM Clientes";
        SqlDataAdapter da = new SqlDataAdapter(sql, cnn);
        DataSet ds = new DataSet();
        //  Rellenamos el objeto DataSet
        da.Fill(ds, "Clientes");
        //  Le asignamos el origen de datos al objeto BindingSource
        // 
        _bs.DataSource = ds;
        //  Objeto DataSet
        _bs.DataMember = "Clientes";
        TextBox1.DataBindings.Add("Text", _bs, "IdCliente");
        TextBox2.DataBindings.Add("Text", _bs, "Nombre");
        //  Enlazamos el control BindingNavigator
        // 
        BindingNavigator1.BindingSource = _bs;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using WCF to send some Linq objects across the wire. I want
I wire up Shadowbox dialog provider to my links or button like this: <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit,
I want to send down a webpage from a server to WebView components on
This is driving me crazy. I'm not including any code because I want to
I am using Google Maps JavaScript API v3. I want to wire up to
I have a situation where I want to render the content from a different
I have a one-hot line that I want to use to select a range
I want to parse a Feedburner feed with HtmlUnit. The feed is this one:
I want to calculate the magnetic field of a wire using biot-savart-law. Some people
VB 2008. I have several text boxes on a form and I want each

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.