My DBML Designer Code is this
[Column(Storage="_id",IsPrimaryKey=true,DbType="Int")]
public System.Nullable<int> id
{
get
{
return this._id;
}
set
{
if ((this._id != value))
{
this._id = value;
}
}
}
and My C # Code this
DataClassesDataContext db = new DataClassesDataContext();
userlogin tc = new userlogin();
tc.username = TextBox1.Text;
tc.pass = TextBox2.Text;
db.userlogins.InsertOnSubmit(tc);
db.SubmitChanges();
Response.Redirect("Main.aspx");
when i am inserting data in text box error come Cannot insert explicit value for identity column in table 'userlogins' when IDENTITY_INSERT is set to OFF
id
column, b) a primary key, c) an identity column. – Damien_The_Unbeliever