excel表的验证 [英] validation for excel sheet

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

问题描述

我想通过Excel工作表在数据库中上传行业名称,但我想做验证只有数字和特殊字符不允许.plz帮助我吗?

I want to upload industry name in database through excel sheet but i want to do validation like only numbers and special character are not allowd.plz help me?

推荐答案

为此你可以做两件事。



1.使用单元格格式,公式等进行excel sheet.ieby的客户端验证。



2.使用reg-expression或其他验证方法对上传数据进行服务器端验证



作为示例如何检查空字符串?



For that you can do 2 things.

1.Do client side validation for excel sheet.i.e.by using cell formatting,formula,etc.

2.Do server side validation for the uploading data by using reg-expression or other validation methods

As a example how to check empty string ?

private string EmptyStringValidation(string strValue, string strFieldName)
        {
            if (string.IsNullOrEmpty(strValue))
            {
                return "Empty " + strFieldName + ", ";
            }
            else
            {
                return string.Empty;
            }

        }





我希望这会对你有所帮助。



I hope this will help to you.


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

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