-4
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 by Nick Evan: Added code-tags, split thread, removed mail

Votes + 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
3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by nick.crane
0

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

0

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.