|
-
Dec 28th, 2005, 09:29 AM
#1
Thread Starter
Fanatic Member
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?
-
Dec 28th, 2005, 09:30 AM
#2
Re: Binding Data
What is the error that you are getting, and where are you getting it?
-
Dec 28th, 2005, 09:57 AM
#3
Thread Starter
Fanatic Member
Re: Binding Data
 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.
-
Dec 28th, 2005, 12:37 PM
#4
Thread Starter
Fanatic Member
Re: Binding Data [RESOLVED]
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|