Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Ascertain table bound to textBox

Ascertain table bound to textBox

Scheduled Pinned Locked Moved C#
question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kanchoette
    wrote on last edited by
    #1

    How can I find which table is bound to a textBox please?

    H 1 Reply Last reply
    0
    • K kanchoette

      How can I find which table is bound to a textBox please?

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

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

      K 1 Reply Last reply
      0
      • H Henry Minute

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

        K Offline
        K Offline
        kanchoette
        wrote on last edited by
        #3

        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.

        H 1 Reply Last reply
        0
        • K kanchoette

          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.

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          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 like DataSource, 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.”

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups