public class ServiceSunday : IServiceSunday { public List<Employee> GetAllEmployee() { List<Employee> employee = new List<Employee>(); string constring = ConfigurationManager.ConnectionStrings["constr"].ConnectionString; SqlConnection con = new SqlConnection(constring); con.Open(); string qry = "select * from EmpDetail"; SqlCommand cmd = new SqlCommand(qry, con); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { Employee emp = new Employee(); emp.EmpNo = dr.GetInt32(0); emp.Name = dr.GetString(1); emp.Empcode = dr.GetString(2); emp.keywords = dr.GetString(3); emp.mobile = dr.GetString(4); employee.Add(emp); } con.Close(); return employee; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)