public void UbdateEmp(Employeeinfo Emp) { using (IDbConnection dbConnection = connection) { string sQuery = @"UBDATE Emptable SET EmpName=@EmpName,Department=@Department,Salary=@Salary WHERE EmpId=@EmpId"; dbConnection.Open(); dbConnection.Query(sQuery, Emp); } }
public void AddEmployee(Employeeinfo ecAdd) { using (IDbConnection dbConnection = connection) { string sQuery = @"INSERT INTO EMPTABLE(EmpName,Department,Salary)VALUES(@EmpName,@Department,@Salary)"; dbConnection.Open(); dbConnection.Execute(sQuery, ecAdd); } }