Return Dataset using SQLCommand

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. I know how to use a SQLDataAdapter to execute a query and return a
dataset. For example...
SQLDataAdapter.Fill(DatasetInstance, "StoredProcName/TableName")

But could someone please give me an example of how to execute a query and
return a dataset using a SQLCommand? SQLCommand doesn't have a .Fill member,
so I'm not sure how to do this.

Thanks.
 
Hi,

Set SqlDataAdapter.SelectCommand to your command and execute Fill method :-)
 
Back
Top