Results 1 to 4 of 4

Thread: Masked Edit Control Sends Unwanted Characters to Database

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    3

    Masked Edit Control Sends Unwanted Characters to Database

    I'm using a masked edit control for my phone number field. But, when I use the update method of my table adapter to update my database, it sends the parenthesis from the mask to the database along with the phone number digits. Is there an easy way to remove the parenthesis from my dataset phone number field before I call the table adapter update method? Could I use a substring function somewhere to extract only the characters I want? Thanks.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Masked Edit Control Sends Unwanted Characters to Database

    The MaskedEditControl has a number of properties that return the text in different ways. I suggest that you test all the likely looking properties to see what they contain until you find the one that is suitable. I'm not trying to be mean by not telling you which one. This is a good exercise in problem solving which will help you solve similar problems in the future.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2006
    Posts
    3

    Re: Masked Edit Control Sends Unwanted Characters to Database

    I had already tried every conceivable combination of the following properties before posting on here:

    textMaskFormat (4 options)
    excludePromptsAndLiterals
    includePrompt
    includeLiterals (default)
    includePromptAndLiterals

    allowPromptsAsInput
    true/false

    promptCharacter


    The prompt character doesn't seem like the issue. It's the parenthesis in my mask that are causing the problem. I have tried everything I can think of in terms of these properties. Nothing works. Can you help me?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Masked Edit Control Sends Unwanted Characters to Database

    ClipText is the text with all the mask literals removed. It is so-named because it is what gets used for clipboard operations. The fact that it has "Text" in the name is what led me to it when I was having the same issue as you many moons ago.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width