Server Side Validation

Posted by Gobi.madura under Regular Expressions on 10/8/2010 | Points: 10 | Views : 1727 | Status : [Member] | Replies : 2
I created a array list and added the username and password in it
And concadinated those two values seperated by comma and stored in a string vriable and passed the string to the DB(For avoiding multiple round trip). It works perfectly for the username and password verfication.

But the requirement is to validate multiple text box in server side, When i go for the same approach for this DB doesn't know Which control holds what value and while returning back am facing control mapping problems.

Please do the needful




Responses

Posted by: Prasham on: 10/8/2010 [Member] Starter | Points: 25

Up
0
Down
Hello,

One possible option is, You can generate XML string (You can use your decided any schema e.g - <Controls><Control><id>textbox1</id><value>12</value1><error/></control></controls>) and pass this as a string to your db. Validate your values and update error node in XML. If you are using stored procedure then you can also use the out parameter.
Once returned from db, validate the XML and you will get the which control has error.

I haven't tried this but hope you will get some idea from this.

Thanks
Prasham

Thanks and Best Regards
Prasham

Gobi.madura, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: T.saravanan on: 10/14/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

My suggestion is to get the Validation values (Previous DB Data) into DataTable before insert (or) update.To check the validation in front end by control wise.I already tried this type of validation its really fast and also to avoid server side validation.

I think its helpful to you.

Thanks,
T.Saravanan

Gobi.madura, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response