コード例 #1
0
ファイル: frmLaiSuat.cs プロジェクト: lechtue/QLTK
        public void GetLoaiTK()
        {
            string        sql       = @"server=DESKTOP-3PAL4OL\SQL; database=QLTK ; Integrated Security=true;";
            SqlConnection conection = new SqlConnection(sql);
            SqlDataReader read;
            SqlCommand    cmd = conection.CreateCommand();

            conection.Open();
            cmd.CommandText = "select * from LoaiTaiKhoan";
            read            = cmd.ExecuteReader();
            qlLoaitk        = new QLLoaiTK();
            while (read.Read())
            {
                LoaiTK loaitk = new LoaiTK();
                loaitk.MaLoai  = read.GetValue(0).ToString();
                loaitk.TenLoai = read.GetValue(1).ToString();
                qlLoaitk.ThemLoaiTK(loaitk);
            }
            cmd.Dispose();
            read.Close();
            conection.Close();
        }
コード例 #2
0
ファイル: LoaiTK.cs プロジェクト: lechtue/QLTK
 public void ThemLoaiTK(LoaiTK loaitk)
 {
     DanhSach.Add(loaitk);
 }