Ascertain table bound to textBox
-
How can I find which table is bound to a textBox please?
-
How can I find which table is bound to a textBox please?
This appears to be a strange question. It might, of course, make perfect sense to you but seems strange to me. :) If it is your
TextBox
you should be aware of this already. If it is not yours, it smells a little like hacking. That is not necessarily a bad thing but if you could explain why you need to do this it would help people to give a sensible answer.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
This appears to be a strange question. It might, of course, make perfect sense to you but seems strange to me. :) If it is your
TextBox
you should be aware of this already. If it is not yours, it smells a little like hacking. That is not necessarily a bad thing but if you could explain why you need to do this it would help people to give a sensible answer.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
No hacking. No excitement here :) My application contains several texboxes which are databound to table(s) containing date fields. The users have a habit of putting dates into the wrong textboxes (Grrrr!!) and then trying to correct the error(s) by attempting to have a blank (null) textbox via the backspace key. The system won't allow this. So, I am trying to create a function which a) understands which textbox it is checking b) locates the correct table databound to that textbox (my question) c) sets the associated table row field to System.DBNull.Value in order for my application to be satisfied with the user's correction. Hope that makes more sense. My apologies for the curt original question. I always assume that all coders are part of the Borg collective :) He he.
-
No hacking. No excitement here :) My application contains several texboxes which are databound to table(s) containing date fields. The users have a habit of putting dates into the wrong textboxes (Grrrr!!) and then trying to correct the error(s) by attempting to have a blank (null) textbox via the backspace key. The system won't allow this. So, I am trying to create a function which a) understands which textbox it is checking b) locates the correct table databound to that textbox (my question) c) sets the associated table row field to System.DBNull.Value in order for my application to be satisfied with the user's correction. Hope that makes more sense. My apologies for the curt original question. I always assume that all coders are part of the Borg collective :) He he.
Each control has a
DataBindings
collection. So you can do something like:Binding bookBinding = this.txtBookingDate.DataBindings\["Text"\]
Amazingly enough you then have a
Binding
instance (bookBinding
) that has properties likeDataSource
,BindingMemberInfo
and others that might be useful. Hope that this helps. :)Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”