开发者

Inserting numeric values alone in SQL Server 2005

开发者 https://www.devze.com 2023-02-28 14:35 出处:网络
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 in

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:

  1. Validate the user input and make sure they only enter numbers in the textbox provided to enter the phone numbers.

  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消