WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 46 users


WorldofASP.NET >> Tutorials And Source Code >> Error Handling

Avoiding a Single Quote Error Reviews


Version: 1.0 | Cost : $ 0 | Script Language : VB | Updated : Mon, Sep 22, 2008 | ASP.NET 1.1
I'm trying to insert a record into database that has an apostrophe. When I build the SQL string it generates a syntax error in the INSERT command. How can I insert a record that has an apostrophe in some fields? Author: Ljubomir
Visit | Error | Avoiding a Single Quote Error Reviews | Add to Favourites
Reviews : 1 | Rating : | Hits Today : 4 | Total Hits : 967


Reviews Written By : Alexander William
  Strengths : This style of programming is easier to type
  Weakness : Its not the best way to do it
  Domain Name :
  Review :
This style of programming is easier to type. But its not a good programming practice to manually use quotes, unquotes in SQL statements. Aside from adding difficulty in debugging, type checking is not supported which will make your code more robust. Example: cmd.Parameters.Add("@titleID", SqlDbType.String) cmd.Parameters["@titleID"].Value = txtTitleID.Text; This way, you have a strong type checking and a more maintainable code.



Write Reviews for Avoiding a Single Quote Error

Use this form below to write your review for this Resource. We hope that you write honest review for this resource. Any inappropriate review will be removed and your account might be deleted.

Your Domain Name related with the resource (if exists)
http://
Pros (What you like about it)
 
Cons ( What you don't like about it)
 
Summary of Your Review (Minimum 20 words)
 
Choose Rating  
Total Word Count : 0
Reward Points : 0

Enter the code shown:






Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2010 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | ASP Hosting | ASP.NET Hosting | Phone Card | Calling Card |Stock Investing