namespace problemvisa { public class Bo { private int id; public int Id { get { return id; } set { id = value; } } private string status; public string Status { get { return status; } set { status = value; } } private string feedback; public string Feedback { get { return feedback; } set { feedback = value; } } 2-DAL public class DAL { public bool insert(Bo aa) { if (aa.Equals(null)) { return false; } else { using (problemEntities1 context = new problemEntities1()) { Table1 tt = new Table1(); context.AddToTable1(tt); context.SaveChanges(); } return true; 3.BAL public class BAL { public bool insert(Bo ss) { DAL dd = new DAL(); if (dd.insert(ss)) { return true; } else { return false; } } IN aspx form protected void Button1_Click(object sender, EventArgs e) { Bo aa = new Bo(); aa.Status = "false"; aa.Feedback = TextBox1.Text; BAL ss = new BAL(); ss.insert(aa); } } One error is coming i.e.Cannot insert the value NULL into column 'feedback', table 'problem.dbo.Table1'; column does not allow nulls. INSERT fails. The statement has been terminated.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)