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. SQL Datatype WinForm Textbox Validation?

SQL Datatype WinForm Textbox Validation?

Scheduled Pinned Locked Moved C#
databaseregexquestion
3 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.
  • T Offline
    T Offline
    tkrn
    wrote on last edited by
    #1

    Just like the title sounds. I am looking for a control or something where I can easily validate textboxes depending on the bound data control to that text box. Ideally, VS2008 would know what kind of data type is bound to that field through the datafield but i doubt if such a thing exists. Even if i have to manually say that this text box is only ment for INT SQL datatypes then limits only to 0-9 would be great with block of adding text characters in that text box. I know I can set the length very easily and this is great for varchar fields that are bound to text boxes but i need something for Floats, Reals, Ints that are bound to text boxes! Any suggestions? FYI, I hate Regex but think i may have to go that route. Are there any regex expressions that are compatible with SQL datatypes?

    N 1 Reply Last reply
    0
    • T tkrn

      Just like the title sounds. I am looking for a control or something where I can easily validate textboxes depending on the bound data control to that text box. Ideally, VS2008 would know what kind of data type is bound to that field through the datafield but i doubt if such a thing exists. Even if i have to manually say that this text box is only ment for INT SQL datatypes then limits only to 0-9 would be great with block of adding text characters in that text box. I know I can set the length very easily and this is great for varchar fields that are bound to text boxes but i need something for Floats, Reals, Ints that are bound to text boxes! Any suggestions? FYI, I hate Regex but think i may have to go that route. Are there any regex expressions that are compatible with SQL datatypes?

      N Offline
      N Offline
      nelsonpaixao
      wrote on last edited by
      #2

      textbox.length propriety There´s no need to create a new control, just validade with code. If you know how to connect to a database what is your problem there? Float, Int, Datetime i work them almost the same way, no special atention. Do you already have done the connection to your database?:confused: What do you have done so far?

      nelsonpaixao@yahoo.com.br

      T 1 Reply Last reply
      0
      • N nelsonpaixao

        textbox.length propriety There´s no need to create a new control, just validade with code. If you know how to connect to a database what is your problem there? Float, Int, Datetime i work them almost the same way, no special atention. Do you already have done the connection to your database?:confused: What do you have done so far?

        nelsonpaixao@yahoo.com.br

        T Offline
        T Offline
        tkrn
        wrote on last edited by
        #3

        The database connections are created using DataSets that are bound to controls to those tables and tableadapters within the dataset. Generally using a binding navigator to cycle through the records where needed.

        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