public DataTable GetAllEmp() { SqlCommand objSelectCommand = DAL_OAI.CreateConnection(); objSelectCommand.CommandText = "SELECT * FROM dbo.T_OAI_Emp"; SchemaTable = new DataTable(); SqlDataAdapter objDataAdapter = new SqlDataAdapter(objSelectCommand); objDataAdapter.Fill(SchemaTable); return(SchemaTable); }
public DataTable GetEmpByDeptno(int deptno) { SqlCommand objSelectCommand = DAL_OAI.CreateConnection(); objSelectCommand.CommandText = "dbo.P_OAI_GetEmpsByDeptno"; objSelectCommand.CommandType = CommandType.StoredProcedure; objSelectCommand.Parameters.AddWithValue("@DEPTNO", deptno); SchemaTable = new DataTable(); SqlDataAdapter objDataAdapter = new SqlDataAdapter(objSelectCommand); objDataAdapter.Fill(SchemaTable); return(SchemaTable); }