Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, friends.
Please help me.
i have a web service, that execute stored procedure, and return data set:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
using System.Data;
using System.Web.Configuration;
using System.Xml;


namespace usingparameterwebservice
{
    /// <summary>
    /// Summary description for mywebservice
    /// </summary>
    [WebService(Namespace = "create_request")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 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 Service1 : System.Web.Services.WebService
    {
        string constring = WebConfigurationManager.ConnectionStrings["Name"].ToString();
        SqlConnection conn;
        SqlCommand comm;

 [WebMethod(Description = "Просмотр заявки")]
        public DataSet Select(string Reques_id, string nameproc)
        {

            SqlConnection myConn = new SqlConnection(constring);
            SqlDataAdapter myData = new SqlDataAdapter(nameproc, myConn);
            myData.SelectCommand.CommandType = CommandType.StoredProcedure;
            myData.SelectCommand.Parameters.Add(new SqlParameter("@id", SqlDbType.Char, 5));
            myData.SelectCommand.Parameters["@id"].Value = Reques_id;


            DataSet ds = new DataSet();
            myData.Fill(ds);

            return ds;
           }
    }
}


The stored procedure do simple select

I need to do a aspx page, where will be a table with data from stored procedure.
How to call web service and retrieve data in normal view from web-service.

Please help!
Posted

1 solution

Take a look at following links, hope it helps you:
aspnet-web-service-or-creating-and-consuming[^]
Creating and Using web service in ASP.Net[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900