About crud operation mvc with class library
How can i update a record in mvc with class library in real time scenarioLike-: webproject.BLL
webproject.BOL
webproject.DAL
webproject.web
namespace CRUDUsingMVC.Repository
{
public class ExampleRepository
{
private SqlConnection con;
private void connection()
{
string constr = ConfigurationManager.ConnectionStrings["getconn"].ToString();
con = new SqlConnection(constr);
}
public bool AddEmployee(EmpModel obj)
{
connection();
SqlCommand com = new SqlCommand("AddNewEmpDetails", con);
com.CommandType = CommandType.StoredProcedure;
com.Parameters.AddWithValue("@Name", obj.Name);
con.Open();
int i = com.ExecuteNonQuery();
con.Close();
if (i >= 1)
{
return true;
}
else
{
return false;
}