public static DataTable GetDataQuay() { try { DataTable dt = new DataTable(); string sql = " select * from QuayHang"; conn = ConnectToSQL_Datvd.Connect(); SqlDataAdapter da = new SqlDataAdapter(sql, conn); da.Fill(dt); conn.Close(); return(dt); } catch { conn.Close(); return(null); } }
public static DataTable GetData() { try { DataTable dt = new DataTable(); string sql = " select MaNV,TenNV,GioiTinh,DiaChi,SDT,NgaySinh,Luong,TenQuay from NhanVien n left join QuayHang q on n.MaQuay=q.MaQuay"; conn = ConnectToSQL_Datvd.Connect(); SqlDataAdapter da = new SqlDataAdapter(sql, conn); da.Fill(dt); conn.Close(); return(dt); } catch { conn.Close(); return(null); } }