3
Answers

While insert Record it will display message recordalready exists Visual studio 2005 with SQL Server

narasiman man

narasiman man

13y
1.5k
1
While insert same  Record it will display message recordalready exists Visual studio 2005 with SQL Server


textbox1 = Projectcode

textbox2 = Projectname
textbox3 = ProjectDesc
textbox4 = Cost

my code:


protected void Button1_Click(object sender, EventArgs e)
{
con.Open();

str = "insert into Project values('"+TextBox1.Text+"','" + TextBox2.Text + "','" + TextBox3.Text + "'," + TextBox4.Text + ")";

cmd = new SqlCommand(str, con);
cmd.ExecuteNonQuery();

Response.Write("Record inserted Successfully");
con.Close();
}

Answers (3)