Special characters

Posted on 2006-05-10
Last Modified: 2013-12-03
System.Data.SqlClient.SqlException: The conversion of the varchar value '312' overflowed an INT1 column. Use a larger integer column. The statement has been terminated. at
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at ams.DAL.DataLayer.RunSQL(String sqlText, Int32& identity)

When a user enters any special charecters like ' ""% etc I am getting the above error. How do I allow user to enter whatever they want.

Pls help.

I am using with
Question by:sureshraina
    LVL 3

    Accepted Solution

    is the problem special characters or that you are trying to insert characters into an int column in your database.

    I'd change the db column to varchar and htmlencode the value or use a validator on the form and only allow numeric input.
    LVL 1

    Expert Comment


    I need more clarification on this.  I want to know that what type value you are passing to the database column.  Mention the type of the column.

    - Suresh

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now