예제 #1
0
        public DataTable GetData()
        {
            DataTable dt = new DataTable();

            cmd.CommandText = "Select * form NhanVien";
            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con.Connection;
            try
            {
                con.OpenConn();
                SqlDataAdapter sda = new SqlDataAdapter();
                sda.Fill(dt);
                con.CloseConn();
            }
            catch (Exception ex)
            {
                string mex = ex.Message;
                cmd.Dispose();//dong phien lam viec
                con.CloseConn();
            }
            return(dt);
            //return DataProvider.Instance.ExecuteQuery("Select * form NhanVien");
        }