My DBML constructor code is
[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 is
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 insert data into a text box, errors come in. It is not possible to insert an explicit value for the identity column in the userlogins table if the IDENTITY_INSERT parameter is set to OFF
source share