Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

  • Administrators
Posted

My C++ isn't the best but try changing the code to something like

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...

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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!!!!????

Posted

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...!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...