473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to return DataSet

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\clConn ect.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,
--
Peter Afonin
Nov 15 '05 #1
2 13442
you need the system.data namespace in your using section at the top of the
file

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Peter Afonin" <pa**@specialtypulltabs.com> wrote in message
news:uS**************@TK2MSFTNGP12.phx.gbl...
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\clConn ect.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,
--
Peter Afonin

Nov 15 '05 #2
Thank you, Alvin.

"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:Or**************@TK2MSFTNGP12.phx.gbl...
you need the system.data namespace in your using section at the top of the
file

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"Peter Afonin" <pa**@specialtypulltabs.com> wrote in message
news:uS**************@TK2MSFTNGP12.phx.gbl...
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\clConn ect.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,
--
Peter Afonin


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: | last post by:
The following function is used in my webservice which returns a dataset. I now need to return the dataset as xml and have no idea how to do it. Can anyone help ? Thanks in Advance Private...
1
by: Patrik | last post by:
Hi I want to return a dataset from a webservice and exclude the schema. How can I do this? /Patrik
2
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in...
13
by: Adie | last post by:
Hi, is this not possible? public DataSet getDimensions() { } public SqlDataReader getDimensions() { }
3
by: Robert May | last post by:
Question, Say I have the following: Using(DataSet ds=new DataSet) { ... da.fill(ds) ... return ds;
7
by: Shaine Fisher | last post by:
I have had a look around but I'm either not finding or not seeing the answer to this, what i want to do is reurn the results as an array, or some other worldly useful format that flash mx2004 can...
1
by: R.A. | last post by:
Hi, I have an web service method that accept an xml document and returns a different xml document. Based on the input xml I fill a dataset with information from a database. If the dataset has...
1
by: HardBap | last post by:
I've created a strongly typed DataSet (Customers.xsd) using the xsd.exe tool. I want to be able to access fields using ds.Customer.CompanyName. The problem is when I return this DataSet from a...
5
by: MounilK | last post by:
this.btnMybtn.Click += new System.EventHandler(this.btnMyBtn_Click); private DataSet btnMyBtn_Click(object sender, System.EventArgs e) { DataSet dtsReportData = ShowReport(); return...
11
by: casucci | last post by:
I do a return as XMLDataDocument in my webservice but it returns not with the namespaces etc in them. Anyone have and example where I can have the webservice return it as a XML. C# preferred....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.