多项选择题
已知变量ds引用某个DataSet对象,该DataSet对象中已包含一个表名为"table1"的数据表。在Windows窗体Form1中,为了将变量名为dataGrid1的DataGrid控件绑定到数据表"table1",可以使用代码()。
A.A
B.B
C.C
D.D
点击查看答案
相关考题
-
单项选择题
已知ds为数据集对象。以下语句的作用是()。ds.Tables["Product"].Constraints.Add(new UniqueConstraint("UC_ProductName",new string[]{"Name","Class"},true));
A.为表"Product"添加一个由列"Name","Class"组合成的主键约束
B.为表"Product"添加一个由列"Name","Class"组合成的唯一性约束
C.为数据集ds添加一个名为"Product"的数据表,并添加两个列,列名分别为"Name"和"Class"
D.为数据集ds添加一个名为"Product"的数据表,并添加一个名为"UC_ProductName"的数据列 -
单项选择题
dt为DataTable类型的变量,引用名为"Customers"的DataTable对象。该表中包含"CustomerID"、"CustomerName"、"Address"、"Telephone"等4列。将数据列"CustomerID"设为该表的主键的正确语句有:()
A.dt.PrimaryKey="CustomerID";
B.dt.PrimaryKey.Add("CustomerID");
C.dt.PrimaryKey=new object[]{"CustomerID"};
D.dt.PrimaryKey=new DataColumn[]{dt.Columns["CustomerID"]}; -
单项选择题
已知ds1、ds2分别代表两个不同的DataSet对象。其中ds1已包含名为“Customer”的DataTable对象,且该DataTable对象被变量dt_Customer引用。已知dt_Customer表中有100条记录,则执行下列语句后,新的数据表new_dt_Customer中包含()条记录。DataTable new_dt_Customer=dt_Customer.Copy();
A.0
B.100
C.200
D.300
