示例#1
0
        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);
        }
示例#2
0
        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);
        }