單項選擇題

數(shù)據(jù)集ds中兩數(shù)據(jù)表(父表:Customer;子表:CartItems)之間有如圖外鍵約束。

父表Customers中有一行數(shù)據(jù)的CustomerID=100,子表CartItems中有20行數(shù)據(jù)的CustomerID=100。若從父表中刪除該行,則:()

A.子表不發(fā)生任何變化
B.子表中20個相關行的CustomerID列的值變?yōu)镈BNull
C.子表中20個相關行被刪除
D.引發(fā)Exception


您可能感興趣的試卷

你可能感興趣的試題

2.單項選擇題已知ds為數(shù)據(jù)集對象。以下語句的作用是()。ds.Tables["Product"].Constraints.Add(new UniqueConstraint("UC_ProductName",new string[]{"Name","Class"},true));

A.為表"Product"添加一個由列"Name","Class"組合成的主鍵約束
B.為表"Product"添加一個由列"Name","Class"組合成的唯一性約束
C.為數(shù)據(jù)集ds添加一個名為"Product"的數(shù)據(jù)表,并添加兩個列,列名分別為"Name"和"Class"
D.為數(shù)據(jù)集ds添加一個名為"Product"的數(shù)據(jù)表,并添加一個名為"UC_ProductName"的數(shù)據(jù)列

3.單項選擇題dt為DataTable類型的變量,引用名為"Customers"的DataTable對象。該表中包含"CustomerID"、"CustomerName"、"Address"、"Telephone"等4列。將數(shù)據(jù)列"CustomerID"設為該表的主鍵的正確語句有:()

A.dt.PrimaryKey="CustomerID";
B.dt.PrimaryKey.Add("CustomerID");
C.dt.PrimaryKey=new object[]{"CustomerID"};
D.dt.PrimaryKey=new DataColumn[]{dt.Columns["CustomerID"]};

5.多項選擇題下列哪些方法可以在DataSet對象ds中添加一個名為“Customers”的DataTable對象?()

A.DataTable dt_customers=new DataTable();
B.DataTable dt_customers=new DataTable("Customers");
C.ds.Tables.Add("Customers");
D.ds.Tables.Add(newDataTable("Customers");