Web Development



Web Service Implementation

By ti3863 ·
I am working on a web service program but is stuck. i dont know what to do after I use the foreach statement to retreive my data.

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Xml;
using System.Xml.Linq;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;
using System.Text;
using System.Drawing;

/// <summary>
/// Summary description for WMS_WHS
/// </summary>
[WebService(Namespace = "http://airforce.af.mil/wmsorder")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WMS_WHS : System.Web.Services.WebService {

public WMS_WHS () {

//Uncomment the following line if using designed components

public string HelloWorld() {
return "Hello World";

[WebMethod(Description = "WMS_WHS_ORDERS")]
public DataSet GETORDERS()
using (SqlConnection WMS_WHSconnection = new SqlConnection(ConfigurationManager.ConnectionStrings["WMS_WHSConnectionString"].ConnectionString))

string Query = "SELECT * FROM [tOrders]";
SqlCommand command = new SqlCommand(Query, WMS_WHSconnection);
command.CommandType = CommandType.Text;

SqlDataAdapter daORDER
= new SqlDataAdapter(Query, WMS_WHSconnection);

DataSet dsWHS = new DataSet("WMS_WHS_ORDERS");
daORDER.FillSchema(dsWHS, SchemaType.Source, "tOrders");
daORDER.Fill(dsWHS, "tOrders");
DataTable tbltOrders;
tbltOrders = dsWHS.Tables["tOrders"];

foreach (DataRow drCurrent in tbltOrders.Rows)





This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Share your knowledge

Related Discussions

Related Forums