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. Web Development
  3. ASP.NET
  4. SQL help in asp.net

SQL help in asp.net

Scheduled Pinned Locked Moved ASP.NET
databasehelpquestioncsharpasp-net
4 Posts 2 Posters 2 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.
  • S Offline
    S Offline
    Smiles74
    wrote on last edited by
    #1

    Hii all, i am confused in which board i have to ask this.. it's related to some logic problem. i am using asp.net and oracle database. i need help to write a sql to check the existed data is matching with the input data.. the problem i am facing is i have a amount filed, which is having different values to each slab setting. ex: slab 1: 1-1000 the amount is 20 slab 2: 1000-2000 the amount is 25.. like this. my problem is restricting user to enter the valid rage only. how do i check the the rage specified is existed in the database. user should not enter in between on range also.. what i mean is suppose if ihave already 1-1000 slab then i should not allow user to enter 500- 1000 again.. I'm trying with slabfrom >= and slabto<= which is not giving what i require..:confused: can any body suggest how to do this?? thanks.. Smile..

    C 1 Reply Last reply
    0
    • S Smiles74

      Hii all, i am confused in which board i have to ask this.. it's related to some logic problem. i am using asp.net and oracle database. i need help to write a sql to check the existed data is matching with the input data.. the problem i am facing is i have a amount filed, which is having different values to each slab setting. ex: slab 1: 1-1000 the amount is 20 slab 2: 1000-2000 the amount is 25.. like this. my problem is restricting user to enter the valid rage only. how do i check the the rage specified is existed in the database. user should not enter in between on range also.. what i mean is suppose if ihave already 1-1000 slab then i should not allow user to enter 500- 1000 again.. I'm trying with slabfrom >= and slabto<= which is not giving what i require..:confused: can any body suggest how to do this?? thanks.. Smile..

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I guess you need a custom validator, which uses data from the database to validate entry.

      Christian Graus - C++ MVP

      S 1 Reply Last reply
      0
      • C Christian Graus

        I guess you need a custom validator, which uses data from the database to validate entry.

        Christian Graus - C++ MVP

        S Offline
        S Offline
        Smiles74
        wrote on last edited by
        #3

        Thank you for ur response mr. Chirstian graus. i donot know how to create custom validator.. abd i d't have time to R&D. if you can suggest me how can i do it other way.. this is the sql code i am using sqlstr = "Select SLABFROM, SLABTO from SLABLIST " _ & " where USERID='" & GlobalVars.SessionUser & "' and (slabfrom>=" & slbfr & " and slabto<=" & slbto & ")" which is in for loop for the grid items. Pls. give me some sort of solution.. Thanking you.

        C 1 Reply Last reply
        0
        • S Smiles74

          Thank you for ur response mr. Chirstian graus. i donot know how to create custom validator.. abd i d't have time to R&D. if you can suggest me how can i do it other way.. this is the sql code i am using sqlstr = "Select SLABFROM, SLABTO from SLABLIST " _ & " where USERID='" & GlobalVars.SessionUser & "' and (slabfrom>=" & slbfr & " and slabto<=" & slbto & ")" which is in for loop for the grid items. Pls. give me some sort of solution.. Thanking you.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          A custom validator is not R&D, it's a basic control provided by the framework.  You create code in the code behind to set if the validator is valid, it can make a DB call and check if the value being passed in is valid, based on what's in the DB. Someone gave you a 1, presumably because you're asking me to do your job.  It wasn't me, but really, if you don't know how to do this stuff, and you don't have the time to learn, then either you shouldn't be doing the project, or your schedule is unreasonable.

          Christian Graus - C++ MVP

          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