Click here to Skip to main content
14,691,238 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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?
Posted
Updated 9-Aug-13 18:53pm
v2
Comments
Maciej Los 9-Aug-13 9:04am
   
We can't read in your mind. We don't see your monitor. Can you help us to understand your issue?

1 solution

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.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900