服务器端验证 [英] Server Side validation

查看:99
本文介绍了服务器端验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道这是否可行,怎么办?
我有一个详细信息"视图,该视图用于插入和编辑SQL Server数据库中的字段.我创建了一个简单的函数,该函数遍历字段数组,然后检查它们是否都不为NULL,但是我还要检查它们是否不超过数据库可以接受的字段长度. 有办法以某种方式检索此信息吗?
然后,我可以检查输入的字段长度是否小于数据库的字段长度.如果没有其他想法
我该怎么办?
我如何进行服务器端验证?

I am wondering if this is possible, if so how?
I have a Details view which I use to Insert and Edit fields in the SQL Server database. I have create simple function which goes through the array of the fields and then checks none of them are NULL, but I also was to check that they will not exceed the length of field the database can accept.
Is there a way to retrieve this information somehow?
Then I can check that the entered field length is less than that of the database. If not any other ideas
How I can do this?
How i can do Server Side validation?

推荐答案

您应限制输入时间本身的最大长度.但是,您会在INFORMATION_SCHEMA.COLUMNS对象中找到列的详细信息.
You should restrict the maximum length in time of entry itself. However you will find the details of columns in INFORMATION_SCHEMA.COLUMNS object.


您需要使用regularexpressionvalidator来检查输入到字段中的数据的长度.
You need to use regularexpressionvalidator to check the length of the data entered into the fields.


如何在c#vs 2005中客户端验证电子邮件地址输入,谢谢.
How to client side validate in c# vs 2005 for email Address input, thank''s.


这篇关于服务器端验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆