BLL,DAL,BO,inserting data

心已入冬 提交于 2019-12-05 15:40:28

BLL talks to the Presentation Layer (ASP.Net pages) DAL talks to the Database (SQL, Oracle, etc) BO are the objects exchanging between BLL and DAL.

You don't have to create another BO for listing and adding data. You can use the same BO object for both purposes.

Ref: http://msdn.microsoft.com/en-us/library/aa581779.aspx

Put everything you want to use for the single object like the following:

BOboj {
        private int _PId;
        private string _Name;
        private int _ClassId;
        private string _ClassName;
}

SqlCommand cmd = new SqlCommand("SPName");

cmd.Parameters.AddWithValue("@PID", obj.PID);
cmd.Parameters.AddWithValue("@Name", obj.Name);
cmd.Parameters.AddWithValue("@ClassID", obj.ClassID);

cmd.ExecuteNonQuery();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!