using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page 
{
    //string connStr = ConfigurationManager.ConnectionStrings["Connection"].ToString();
  

    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected void btnclear_Click(object sender, EventArgs e)
    {
        txtfname.Text = "";
        txtlname.Text = "";
        txtpssd.Text = "";
        txtcpssd.Text = "";
        txtage.Text = "";
        txtemail.Text = "";

    }
    protected void btnsubmit_Click(object sender, EventArgs e)
    {
        //SqlConnection con = new SqlConnection(connStr);
        SqlConnection con = new SqlConnection("server=.;database=master;Integrated Security=true;");
        con.Open();
        SqlCommand cmd = new SqlCommand("insert into example values('"+txtfname.Text+"','"+txtlname.Text+"'),con");
        cmd.ExecuteNonQuery();
        con.Close();
    }
}

IM GETTING ERROR PLS RECTIFY THE ERROR AND SOLVE MY PROBLEM PLS my mail <<snip>>

Edited 6 Years Ago by Nick Evan: Added code-tags, split thread, removed mail

Comments
You mean "please help me find the error so *I* can rectify it by doing some work on my own" right?
I think you should USE MORE CAPS! MAYBE IT'LL HELP!
1. Old thread, 2. No code tags, 3. Don't demand, especially in caps

let us know where the error is occurring and the error is and which line is having the error..?
its difficult for us to analyze where the error is probably to occur..?

The error is in this line.

SqlCommand cmd = new SqlCommand("insert into example values('"+txtfname.Text+"','"+txtlname.Text+"'),con");

Check the position of your quote marks (").

This article has been dead for over six months. Start a new discussion instead.