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.
Reza TaherPosted Aug 13, 2008, 5:54 PM
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
Anna HawksPosted Aug 13, 2008, 11:21 AM