How to return DataSet

P

Peter Afonin

Hello:

I'm creating an ASP.Net application. I need to run a method that would
return a DataSet. I'm new to C#, so I have a problem with it.

In VB.Net I just used to write a function like this:

Public Function GetOrders(ByVal sSQL As String) As DataSet

In C# when I try to write something like this:

public DataSet CreateDataset(string sSQL)
{
}

I get an error:
"D:\C#_Projects\connect_class\connect_class\clConnect.cs(16): The type or
namespace name 'DataSet' could not be found (are you missing a using
directive or an assembly reference?)"

How would I do this?

Thank you very much in advance,
 
A

Alvin Bruney

you need the system.data namespace in your using section at the top of the
file
 

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