Results 1 to 4 of 4

Thread: Binding Data

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Binding Data

    What is wrong in this?

    HTML Code:
    Binding handlerBalance = new Binding("Text", dtcatalogo, "balance_inicial");
    handlerBalance.Format+=new ConvertEventHandler(MoneyTostring);        
    handlerBalance.Parse+=new ConvertEventHandler(stringToMoney);   
    txtbalance_inicial.DataBindings.Add(handlerBalance);
    When i try to run the program i got an error.
    I have the same on other program and everything is ok.
    Any hlp?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Binding Data

    What is the error that you are getting, and where are you getting it?

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Re: Binding Data

    Quote Originally Posted by Hack
    What is the error that you are getting, and where are you getting it?
    This is the code:

    HTML Code:
    private void BindData_to_Text()
    {
      txtnumero_cuenta.DataBindings.Add("Text", dtcatalogo, "Numero_Cuenta");
      txtdescripcion.DataBindings.Add("Text", dtcatalogo, "descripcion");
    
      Binding handlerBalance = new Binding("Text", dtcatalogo, "balance_inicial");
      handlerBalance.Format+=new ConvertEventHandler(MoneyTostring);        
      handlerBalance.Parse+=new ConvertEventHandler(stringToMoney);
        
      txtbalance_inicial.DataBindings.Add(handlerBalance);
    }
    This is the error;
    An unhandled exception of type 'System.ArgumentException' occurred in System.windows.forms.dll

    Additional information: cannot bind to property or column balance_inicial on datasource

    With the first two(2) lines everything is ok and i get not error.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Santo Domingo,D.N., Dom. Rep.
    Posts
    707

    Re: Binding Data [RESOLVED]

    Quote Originally Posted by Luis Moises Rojas
    This is the code:

    HTML Code:
    private void BindData_to_Text()
    {
      txtnumero_cuenta.DataBindings.Add("Text", dtcatalogo, "Numero_Cuenta");
      txtdescripcion.DataBindings.Add("Text", dtcatalogo, "descripcion");
    
      Binding handlerBalance = new Binding("Text", dtcatalogo, "balance_inicial");
      handlerBalance.Format+=new ConvertEventHandler(MoneyTostring);        
      handlerBalance.Parse+=new ConvertEventHandler(stringToMoney);
        
      txtbalance_inicial.DataBindings.Add(handlerBalance);
    }
    This is the error;
    An unhandled exception of type 'System.ArgumentException' occurred in System.windows.forms.dll

    Additional information: cannot bind to property or column balance_inicial on datasource

    With the first two(2) lines everything is ok and i get not error.
    My friends, the problem was on the dataset.
    Because, i have: select x1,x2 from table but the fields balance_inicial was not on the select.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width