70-516 · Question #95
70-516 Question #95: Real Exam Question with Answer & Explanation
The correct answer is A. var dt = new taStore.ProductDataTable();. DataRowCollection.Find() Method To use the Find method, the DataTable object to which the DataRowCollection object belongs to must have at least one column designated as a primary key column. See the PrimaryKey property for details on creating a PrimaryKey column, or an array of
Question
Options
- Avar dt = new taStore.ProductDataTable();
- Bvar ta = new taStoreTableAdapters.ProductTableAdapter();
- Cvar dt = new taStore.ProductDataTable();
- Dvar dt = new taStore.ProductDataTable();
Explanation
DataRowCollection.Find() Method To use the Find method, the DataTable object to which the DataRowCollection object belongs to must have at least one column designated as a primary key column. See the PrimaryKey property for details on creating a PrimaryKey column, or an array of DataColumn objects when the table has more than one primary key. var dt = new CustomersDS.CustomersDataTable(); var ta = new CustomersDSTableAdapters.CustomersTableAdapter(); CustomersDS.CustomersRow row = (CustomersDS.CustomersRow)dt.Rows.Find(4); row.Name = "A. Found Customer Id"; DataTable.Select() Method Gets an array of all DataRow objects that match the filter criteria. To create the filterExpression argument, use the same rules that apply to the DataColumn class's Expression property value for creating filters. var ta = new CustomersDSTableAdapters.CustomersTableAdapter(); var dt = ta.GetData(); var row = dt.Select("CustomerID > 2"); row[0]["Name"] = "B. Found Customer Id"; TableAdapter Overview
Community Discussion
No community discussion yet for this question.