Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > bind multiple entries to the one textbox
 

bind multiple entries to the one textbox

Hey,

is it possible to add multiple entries from a table into one text box, like joining them.

so i can have something like

txtAddress.DataBindings.Add("text", ds, "Customers.CustomerAddress")
txtAddress.DataBindings.Add("text", ds, "Customers.CustomerPostcode")
in the same text box, with a space in between?
kidwizz  Tuesday, September 01, 2009 12:26 AM
Not that I am aware of.

If you are using a SQL statement or stored procedure, you could do the appending there and use an alias to return it as a single field.

Hope this helps.

www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Tuesday, September 01, 2009 3:46 AM
Not that I am aware of.

If you are using a SQL statement or stored procedure, you could do the appending there and use an alias to return it as a single field.

Hope this helps.

www.insteptech.com ; msmvps.com/blogs/deborahk
We are volunteers and ask only that if we are able to help you, that you mark our reply as your answer. THANKS!
DeborahK  Tuesday, September 01, 2009 3:46 AM
You can bind it to one of the columns and setup a format event where you get the other columns and add their values and if necessary also a parse event where you split the text and put it back into the correct columns.

--
Wolfgang
Wollinet  Tuesday, September 01, 2009 6:57 AM
Hi kidwizz,

Simple binding doesn't support to bind the same property twice. You will meet error like that, "This causes two bindings in the collection to bind to the same property."

I think DeborahK's suggestion is correct, you can do the combination in the stored procedure. Then bind it with TextBox control's Text property.

If you have anything unclear, please feel free to tell me.

Sincerely,
Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Thursday, September 03, 2009 3:13 AM

You can use google to search for other answers

Custom Search

More Threads

• Columm in SQL
• Add User Control in Datagrid View
• Image in datagridview
• FILL Method
• Form Scrolling - Need some help please
• How To Bind Data To : DataGridViewCheckBoxColumn
• Web Service Objects and INotifyPropertyChanged
• How to catch DataError ???????
• Unconventional use of Tableadapters
• Newbie: Data app tutorial