Adding to a dataset

  • Thread starter Philip Townsend
  • Start date
P

Philip Townsend

I have a user control that populates a dataset from a stored procedure.
In the event that the stored procedure returns an empty result set, I
want to add a record to the dataset indicating to the user that the
search returned nothing. How should I add a value to the dataset?
 
D

Dmitriy Lapshin [C# / .NET MVP]

Philip,

You cannot add a row to a data set, but you definitely can add a row to a
data table.
Add a new data table to the data set, set up a single string column for this
data table, and then add a row with the explanation text with the table's
AddRow method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top