SQL help in asp.net
-
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..
-
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..
I guess you need a custom validator, which uses data from the database to validate entry.
Christian Graus - C++ MVP
-
I guess you need a custom validator, which uses data from the database to validate entry.
Christian Graus - C++ MVP
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.
-
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.
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