?
Solved

web service and store procedure

Posted on 2010-08-17
5
Medium Priority
?
484 Views
Last Modified: 2012-05-10
Hi experts. i have this store procedure

create procedure [certifica].[ObtenerCodigoCurso]
   @abreviatura varchar(10)
as
select
         C.CODCURSO,
         C.NOMBRECURSO,
         C.FECHAINICIOCURSO,
         C.FECHAFINCURSO,
         C.NOMBRESEDE,
       C.NUMERORESOLUCION,
       C.CODTIPOCALIFICATIVO
from  intranetamag.CURSO C
where C.ABREVIATURA = @abreviatura

I do consume a web service that this store procedure, please help
I am working with Microsoft Visual Studio 2008
0
Comment
Question by:enrique_aeo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 8

Accepted Solution

by:
Yiogi earned 1000 total points
ID: 33460436
What are you trying to do? Return an xml dataset based on your stored procedure from your service? Then it's as simple as this:


    [WebMethod]
    public DataSet GetSPData() {
        SqlConnection con;
        SqlCommand cmd;
        SqlDataAdapter adpt;
        DataSet ds = new DataSet();
        string SP = "certifica.ObtenerCodigoCurso";
        con = new SqlConnection(ConfigurationManager.ConnectionStrings["YourConnectionString"].ConnectionString);
        cmd = new SqlCommand(SP, con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("@abreviatura ", SqlDbType.NVarChar, 10).Value = "PARAMVALUE";
        adpt = new SqlDataAdapter(cmd);
        con.Open();
        adpt.Fill(ds);
        con.Close();
        return ds;
}

Open in new window

0
 

Author Comment

by:enrique_aeo
ID: 33464762
ok, that part is fine, but I need something like a hands on lab to create the web services
0
 
LVL 22

Assisted Solution

by:Om Prakash
Om Prakash earned 1000 total points
ID: 33472424
0
 

Author Comment

by:enrique_aeo
ID: 33473584
i am loooking like that
http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/02/10/how-to-build-an-n-tier-application-with-wcf-and-datasets-in-visual-studio-2008.aspx,
but on web services
that is, showing how to use visual studio 2008 to make a complete solution (create the service and consume it from a web application), I buscao and can not find, that is why I turn to you
0
 

Author Comment

by:enrique_aeo
ID: 33489439
In Solution Explorer, right-click Solution 'AdventureWorksSite', point to Add,
and then click New Project.
2. In the Add New Project dialog box, create an ASP.NET Web Service
Application project with the following properties:
• Project types: Visual C# or Visual Basic.
• Name: ReviewsWebService
3. In Solution Explorer, right-click Service1.asmx, and then rename it to
Reviews.asmx.
4. Open the Reviews.asmx file in Code view.
5. In the Reviews.asmx.cs or Reviews.asmx.vb file, change the name of the class
from Service1 to Reviews.
6. View the markup of the Reviews.asmx file.
7. In the @ WebService directive, change the class attribute to
ReviewsWebService.Reviews.
8. Save your changes.

-put code

Test the GetReviews XML Web service method
1. Build the ReviewsWebService.
2. View the Reviews.asmx page in the browser.
The description page of the XML Web service is displayed. Note the
description information for the Web service and Web method.
3. In the browser, click GetReviews.
4. In the productID box, type 709 and then click Invoke.
The browser displays the XML response from the XML Web service.
5. Close both browser windows.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question