Tuesday 31 January 2012

SQL ERROR : UNCLOSED QUOTATION MARK AFTER THE CHARACTER STRING ')

Sql Error : Unclosed quotation mark after the character string ')

Hi This Sql Error I am Facing When Creating Forum Website.

This Error ( Unclosed quotation mark after the character string ') ) I am Getting When Inserting New Thread To Sql Server..

I am Creating Forum Website Using 3 Tier Architecture

In That I Having a Questions Table

In Questions Table I Have 5 Fields

uid 
catagoryid 
date 
title 
description 



Button Click Event In Asp.Net To Post New Thread :



protected void btnpostthread_Click(object sender, EventArgs e)
    {
        try
        {

            thread.uid = 1;
            thread.catagoryid = 1;
            thread.date = DateTime.Today;
            thread.title = txttitle.Text;
            thread.description = Editor.Text;


            thread.InsertNewThread();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }




This Is My Sql Query :


public bool InsertNewThread()
    {
        try
        {
            Squery = "insert into question values "
                + " (" + uid + "," + catagoryid + ",'" + date + "','" + title + "', "
            + " '" + description + "')";
            return dal.exenonquery(Squery);
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

Here I List Out The Website's For Error Clarification's

http://social.msdn.microsoft.com/Forums/en/transactsql/thread/c34279b1-639e-43f3-bcb0-8582f076e31e

http://social.msdn.microsoft.com/Forums/en/transactsql/thread/3ce4d130-0bf8-456d-a30d-029e4086a38e

http://social.msdn.microsoft.com/Forums/en/transactsql/thread/82c1729d-fa5f-470c-9de6-287661310d68

http://website-tools.net/google-keyword/site/www.dotnetfunda.com

http://itpian.com/Coding/Incorrect-syntax-near-fff-Unclosed-quotation-mark-after-the-character-string.aspx

This Will Help To All..


0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
^ Scroll to Top Twitter Bird Gadget