473,379 Members | 1,491 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,379 software developers and data experts.

return all records using Web Service

1
Hi.

I am new to web services. Could someone please help me with the scripts below?

I will be parsing a GroupID to the web service. This web services will the connect to a stored procedure which will return all records belonging to the GroupID. My problem is how do i "return" the row and columns of data to the C# page that is requesting the Web Service?

heres part of my Web service scripts...
Thanks

[PHP] [WebMethod]
public string FetchRecords(int GroupID, string View){
SqlCommand command = new SqlCommand();

DataSet dataSet = new DataSet();

string sp = "";
if (retriveNum != null){
sp = "sp_GetAllRecords";
}
else
sp = "sp_GetTop10Records";

SqlDataAdapter dataAdapter = new SqlDataAdapter(sp, Connection_string);
dataAdapter.SelectCommand.CommandType = CommandType.StoredProcedure;

dataAdapter.SelectCommand.Parameters.Add("@GroupID ", SqlDbType.Int);
dataAdapter.SelectCommand.Parameters["@GroupID"].Value = GroupID;


}[/PHP]
Apr 1 '08 #1
1 1155
nateraaaa
663 Expert 512MB
I believe the DataTable object is serializable and can be sent as a response via XML. Try returning a DataTable with the row and column data.

Expand|Select|Wrap|Line Numbers
  1.  DataTable dataTable = dataSet.Tables[0];  
  2.  
Nathan
Apr 1 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
3
by: Stewart | last post by:
Hi all! My (relatively small) database holds data on staff members and the projects (services) that they are assigned to. In my form frmStaff, I have a list of staff members - it is a...
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: John | last post by:
Hi, I am implementing web services and try to return a collection of records, say 1,"John","Doe",1/1/1990 2,"Jane","Doe",2/1/1990 3,"Joe","Smith",3/1/1990 .......
3
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we...
1
by: RussCRM | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
2
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for...
2
by: wevans | last post by:
Somehow I need to only return 1 record if there's two or more in the tables. I'm using this to create a mailing list labels so I don't want to print two or more labels for the same person. I want to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.