Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

How do I find the name of a DataTable in a Dataset in example code.

Can you tell me were the DataTable object is and it's name in the code below? I can only see a Dim of the DataSet but where is the DataTable? The following comes from the MSDN website:

"The Fill method of the DataAdapter is used to populate a DataSet with the results of the SelectCommand of the DataAdapter. Fill takes as its arguments a DataSet to be populated, and a DataTable object, or the name of the DataTable to be filled with the rows returned from the SelectCommand".

' Assumes that connection is a valid SqlConnection object.
Dim queryString As String = _
  "SELECT CustomerID, CompanyName FROM dbo.Customers"
Dim adapter As SqlDataAdapter = New SqlDataAdapter( _
  queryString, connection)

Dim customers As DataSet = New DataSet
adapter.Fill(customers, "Customers")


0
rfgraham
Asked:
rfgraham
1 Solution
 
sunnycoderCommented:
Hello rfgraham,

"Customers" is the name of the DataTable
Fill method  is overloaded. This is the instance that is being called
http://msdn.microsoft.com/en-us/library/y4b211hz.aspx

Regards,

sunnycoder
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now