nerdexam
Microsoft

70-516 · Question #239

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. You use the following SQL statement to…

The correct answer is B. from row in ds.Tables(0).AsEnumerable(). Field<T>(DataRow, String) Provides strongly-typed access to each of the column values in the The Field method also supports nullable types.

Querying Data

Question

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. You use the following SQL statement to retrieve an instance of a DataSet object named ds. SELECT CustomerID, CompanyName, ContactName, Address, City FROM dbo.Customers You need to query the DataSet object to retrieve only the rows where the ContactName field is not NULL. Which code segment should you use?

Options

  • Afrom row in ds.Tables(0).AsEnumerable()
  • Bfrom row in ds.Tables(0).AsEnumerable()
  • Cfrom row in ds.Tables(0).AsEnumerable()
  • Dfrom row in ds.Tables(0).AsEnumerable()

How the community answered

(54 responses)
  • A
    9% (5)
  • B
    81% (44)
  • C
    4% (2)
  • D
    6% (3)

Explanation

Field<T>(DataRow, String) Provides strongly-typed access to each of the column values in the The Field method also supports nullable types.

Topics

#LINQ to DataSet#AsEnumerable#null filtering#DataTable

Community Discussion

No community discussion yet for this question.

Full 70-516 Practice