CREATE TABLE [dbo].[login] (
[Id] NVARCHAR (50) NOT NULL,
[username] NCHAR (10) NOT NULL,
[password] NCHAR (10) NOT NULL,
[Phone_no] NVARCHAR (50) NOT NULL,
[Email] NVARCHAR (50) NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class reg : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\SONY\Documents\data.mdf;Integrated Security=True;Connect Timeout=30");
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
}
protected void btn_submit_Click(object sender, EventArgs e)
{
Guid newGUID = Guid.NewGuid();
string insert = "insert into login(Id,username,password,Phone_no,Email) values('" + newGUID.ToString() + "','" + txt_name + "','" + Text_pass + "','" + Text_ph + "','" + Text_mail + "')";
SqlCommand cmd = new SqlCommand(insert ,con);
cmd.Connection = con;
cmd.ExecuteNonQuery();
con.Close();
Lbl_reg.Visible = true;
}
}
When i m trying to save the value then get above mentioned error