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.