I am running ASP.NET application written in C# and using SQL Server 200开发者_JAVA技巧5. I am having a contact number textbox in which I have to enter integers alone. I want the database to get the integers alone but if I give characters also it is getting entered. How can I avoid characters to store in the database? How to code for this?
As per the information that you've provided, there are 2 things that you need to do:
Validate the user input and make sure they only enter numbers in the textbox provided to enter the phone numbers.
Make sure the column in your SQL table to store the contact number is an int and not a varchar/char.
Hope this makes sense.
精彩评论