void GetAllEmployee(object sender, ServiceReference1.GetEmployeeCompletedEventArgs e)
//################## MY SERVICE CODE WORKING HERE WORKING FINE ###############################################
public class Service1
{
string CONENCTIONSTRING = System.Configuration.ConfigurationManager.ConnectionStrings["SWE"].ConnectionString;
[OperationContract]
public List<Employee> GetEmployee()
{
// Employee employee = new Employee();
List<Employee> employee = new List<Employee>();
using (SqlConnection con = new SqlConnection(CONENCTIONSTRING))
{
using (SqlCommand CMD = new SqlCommand())
{
CMD.Connection = con;
CMD.CommandText = "select EmpName from Employee where EmpNo=101";
CMD.CommandTimeout = 600;
con.Open();
SqlDataReader READER = CMD.ExecuteReader();
while (READER.Read())
{
Employee EMP = new Employee();
// EMP.EmpNo = Convert.ToInt32(READER[0].ToString());
EMP.EmpNme = READER[0].ToString();
//EMP.EmpAddres = READER[2].ToString();
//EMP.EmpSalary = Convert.ToInt32(READER[3].ToString());
//EMP.EmpEducation = Convert.ToInt32(READER[4].ToString());
employee.Add(EMP);
}
}
}
return employee.ToList();
}