TextBox->DataBindings->Help

Psygnus

Newcomer
Joined
Jul 25, 2005
Messages
6
Hello everybody!
I'm sorry to post about this issue again but i've read almost all posts that i found and couldn't get the answer :o (stupid)
(Nobody uses C++.NET anymore???)

What i need to understand is how to bind a TextBox 's Text with a column of a Database Table.
I ' ve connected my Form to a db Table named "Managers" creating an oleDbConnection and oleDbAdapter and then i generated a Dataset.

I want now to bind the Text property of a Textbox, with the column "Name" of the table "Managers".

So i write the following:
textBox1->DataBindings->Add(new System::Windows::Forms::Binding(S"Text", this->dataSet11 ,S"Managers.Name" ));

What's wrong with this?
I feel that i miss the point and the code above isn't the problem...

Please help me as you can!
Thank you in advance!
 
My C++ isn't the best but try changing the code to something like
Code:
textBox1->DataBindings->Add(new System::Windows::Forms::Binding(S"Text", this->dataSet11.Tables["Managers"] ,S"Name" ));

Not sure if the .Tables[] syntax is correct - the idea is to refere to the DataTable in the 2nd parameter...
 
I tried in C# the code you 've written for me for the same thing.

textBox1.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.dataSet11.Tables["Managers"] , "Name"));

There are no syntax errors but the text of the textbox doesn't change...

As i said i think i miss the point...
The funny thing is that the examples for the databindings in MSDN are exactly like the ones you and i wrote!
Why the heck doesn't it work!!!!????
 
Oh S**T!!!!!!!
Why it always has to be SO SIMPLE?@!@#!$!#%

You search all day to find a bug and in the end you find out that you 're a bug yourself....

I had the line that fills the dataset in comments@#%!%!!!!$%^&

I feel so stupid...!!
Thank you a lot PlausiblyDamp...!
 
Back
Top