Пример #1
0
        public void Them_Sua_Xoa(string sql)
        {
            clsXuLy cn = new clsXuLy();

            cn.KetNoi();
            try
            {
                SqlCommand cmd = new SqlCommand(sql, cn.con);
                cmd.ExecuteNonQuery();
                cn.DongKetNoi();
            }
            catch { }
        }
Пример #2
0
        public DataTable GetData(string sql)
        {
            clsXuLy cn = new clsXuLy();

            cn.KetNoi();
            DataSet ds = new DataSet();

            try
            {
                SqlDataAdapter dta = new SqlDataAdapter(sql, cn.con);
                dta.Fill(ds, sql);
                DataTable tbl = ds.Tables[0];
                return(tbl);
            }
            catch
            {
                return(null);
            }
        }