We can bind a textbox to column using this command:
lblCust_ID.DataBindings.Add(
new Binding("Text", bsOrder, "CUST_ID", true));Is there any way to find the database column name after binding it to a textbox. I need to find programmatically that CUST_ID is the name of column which has been bound to lblCust_ID.

Anna Hawks102 reputationPosted Aug 13, 2008, 7:21 AM EDT
Reza Taher5 reputationPosted Aug 13, 2008, 1:54 PM EDT
Fortunately I found the solution. Here is the answer:
MessageBox
.Show(lblCust_ID.DataBindings[0].BindingMemberInfo.BindingField.ToString());The result is CUST_ID which is the excat column name we have already assigned to lblCust_ID.
thanks