單項選擇題

DataSet對象ds中,數(shù)據(jù)表對象Customers的表名為"Customers",其表結(jié)構(gòu)如下:

則下列向該表添加一行新數(shù)據(jù)的語句是否正確?()

A.正確
B.錯誤


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題

數(shù)據(jù)集對象dsNorthwind包含兩個表,表名分別為"Customers"和"Orders"。執(zhí)行下列語句:

該語句運行結(jié)果有()。

A.為dsNorthwind創(chuàng)建了表"Customers"和"Orders"之間的導(dǎo)航關(guān)系
B.為表"Customers"創(chuàng)建了一個唯一性約束
C.為表"Orders"創(chuàng)建了一個唯一性約束
D.為表"Customers"創(chuàng)建了一個外鍵約束,其父表為"Orders"
E.為表"Orders"創(chuàng)建了一個外鍵約束,其父表為"Customers"

4.單項選擇題已知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ù)列

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

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