[Webinar] Streamline your web hosting managementRegister Today


Returning a dataset

Posted on 2008-01-29
Medium Priority
Last Modified: 2010-04-23
I have an app that calls a web service and passes it a variable "uName"
It first hits my servie level like below.
Then to the businees layer and then the data layer.  The data layer calls a stored procedure and returns the data everything works.
When the Return dataset goes back to the business layer the ds is empty.
<WebMethod()> _
    Public Function GetCustInfo(ByVal uName As String) As DataSet
        Return objBusiness.GetCustInfo(uName)
    End Function
Data Layer
Public Function GetCustInfo(ByVal uName As String) As DataSet
        Dim db As dbAccess = New dbAccess
        Dim param As SqlParameter
        Dim parameters As ArrayList = New ArrayList
        Dim ds As DataSet
        param = New SqlParameter("@uName", uName)
        ds = db.RunSPSQLServer("spGetCustInfo", parameters)
        ds.Tables(0).TableName = "CustInfo"
        Return ds
    End Function

Open in new window

Question by:triplebd69
  • 2
LVL 64

Accepted Solution

Fernando Soto earned 2000 total points
ID: 20777519
Hi triplebd69;

Place a break point at this line in the code, "ds.Tables(0).TableName = "CustInfo"", make sure that, db.RunSPSQLServer("spGetCustInfo", parameters), returned a data set and that it has a table in it with data.


Author Comment

ID: 20777622
In the service layer I needed to change the code to like below.

Dim ds As DataSet = objDataObject.GetCustInfo(uName)
Return ds
LVL 64

Expert Comment

by:Fernando Soto
ID: 20777679
Glad to see that you have resolved your issue. Have a great day.  ;=)

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

608 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