intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Bài giảng Lập trình trên Windows với Microsoft® .NET: Bài 10 - Hồ Hoàn Kiếm

Chia sẻ: Lavie Lavie | Ngày: | Loại File: PPT | Số trang:11

61
lượt xem
4
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

Mời các bạn tham khảo bài giảng Lập trình trên Windows với Microsoft® .NET: Bài 10 của Hồ Hoàn Kiếm sau đây để nắm bắt được những nội dung về SqlCommand; DataSet; Create a DataTable; Insert data into DataTable; DataView; DataBinding.

Chủ đề:
Lưu

Nội dung Text: Bài giảng Lập trình trên Windows với Microsoft® .NET: Bài 10 - Hồ Hoàn Kiếm

  1. Lập trình trên Windows  với Microsoft® .NET Giảng viên : Hồ Hoàn Kiếm
  2. SqlDataAdapter  Bộ lọc dữ liệu.  Phân trang dữ liệu.  Phương thức fill(datasource); fill(datasource,start,number,”tablename”)
  3. SqlCommand  Thực thi câu lệnh SQL.  Phương thức : ExecuteNonQuery() ExecuteScala() ExecuteReader()
  4. DataSet  Chứa dữ liệu trả về từ DataAdapter.  “Cơ sở dữ liệu thu nhỏ”.  Gồm các đối tượng : - DataTable - DataRelation
  5. DataSet  Mô hình DataSet
  6. DataTable  Chứa dữ liệu trả về DataSet hoặc DataAdapter.  Gồm các đối tượng : - DataColumn - DataRow
  7. Create a DataTable  myTable.Columns.Add("ItemID",Type.GetType("System.In t32"));  myTable.Columns.Add("ItemName",Type.GetType("Syste m.String"));  myTable.Columns.Add("Quantity",Type.GetType("System.I nt32"));  myTable.Columns.Add("Quantity",Type.GetType("System.f loat"));  // thêm column mới vào table  myTable.Columns.Add(myColumn);  myTable.Columns.Add("SubTotal",Type.GetType("System. Int32"),"Quantity*Price");  myTable.PrimaryKey = new DataColumn[] {myTable.Columns[0]};
  8. Insert data into DataTable  // Thêm 10 dòng vào Table  DataRow myRow;  for(int i = 0; i < 10; i++)  {  myRow = myTable.NewRow();  myRow["ItemID"] = i + 1;  myRow["Price"] = i*2+1;  myRow["ItemName"] = (60+i);  myRow["Quantity"] = i + 1;  myTable.Rows.Add(myRow);  }
  9. DataView  Dùng để quản lý và thao tác dữ liệu trong DataTable…  Dùng để lọc , sắp xếp dữ liệu trong DataTable
  10. DataView
  11. DataBinding  Hiển thị dữ liệu trong DataTable…vào các control ( TextBox, ComboBox, DataGrid…)  Gồm 2 loại chính : - Binding Sample - Binding Complex
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2