[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

web service and store procedure

Posted on 2010-08-17
5
Medium Priority
?
489 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

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

649 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