Tạo cơ sở dữ liệu VIDEO Tạo 1 class để thao tác với sơ sơ dữ liệu PHP: public class DataService { string chuoiketnoi = ConfigurationManager . ConnectionStrings [ "QLBH" ]. ConnectionString ; SqlConnection ketnoi ; public DataService () { } public void MoKetNoi () { ketnoi = new SqlConnection ( chuoiketnoi ); ketnoi . Open (); } public void DongKetNoi () { ketnoi . Close (); } public bool KTDangNhap ( string user , string pas ) { MoKetNoi (); SqlCommand comand = new SqlCommand ( "select * from nguoidung where TenDangNhap = '" + user + "' and MatKhau='" + pas + "'" , ketnoi ); SqlDataReader reder = comand . ExecuteReader (); bool kn = false ; if ( reder . HasRows == true ) kn
Nơi chia sẽ kiến thức CNTT, lập trình . . .