Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have a sql database with a table Person. This Table has a field Dist.

The definition of this field in sql,

Dist (Numeriic (10,0)


VB
For Each table In ds.Tables

    For Each dc In table.Columns

        Debug.Print(dc.ColumnName)
        

    Next


How can I verify that the user does not enter higher value then "Numeric(10,0)"
Posted

1 solution

Put validation before saving data to database.


int numberVal = 12345;
int length = numberVal.ToString().Length;

If(lenght > 10)
{
"Give Some message";
return;
}
 
Share this answer
 

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