Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 9th, 2003, 12:33 PM
Registered User
Join Date: Sep 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Webservice displays only 1 instead of ALL results

Hi there

I've just started with webservices and have written a small function to get all the records from a database matching a date string.

Anyway, it seems to find the relevant records but only displays ONE and not all.

I've tried using datasets, datareaders, etc. all still give me one record instead of every one matching my criteria.

Here is my code for the function.

<WebService(Namespace:="http://ZeusProject.com")> _
Public Class Service3

    Inherits System.Web.Services.WebService

    <WebMethod()> Public Function getconnectiondate(ByVal connectiondate As DateTime) As connectiondateresult
        Dim Strconnect As String = dbstring2
        Dim objconnect As New OleDbConnection(Strconnect)
        Dim objcommand As New OleDbCommand()
        Dim results As New connectiondateresult()
        results.requestok = True
        Dim selectaudit As String = _
      "select * from accountdetails"

        objcommand.Connection = objconnect
        objcommand.CommandType = CommandType.Text
        objcommand.CommandText = selectaudit

        Dim objdataadapter As New OleDbDataAdapter()
        objdataadapter.SelectCommand() = objcommand

        Dim objdataset As New DataSet()
        objcommand.CommandText = selectaudit

        objdataadapter.Fill(objdataset, "Audit")

        Dim objDataView As New DataView()
        ' Dim objDataView2 As New DataView()
        ' Dim objDataView3 As New DataView()
        If objdataset.Tables(0).Rows.Count > 0 Then

            'If reader("connectiondate") = connectiondate Then

            'If reader.GetSqlDateTime("connectiondate") = "" Then

            'results.ismisc = True

            ' results.ismisc = False

            'End If
            results.exists = True
            Dim tbl As DataTable = objdataset.Tables("Audit")
            Dim row As DataRow = tbl.Rows(0)
            ' results.username = reader("username")

            results.username = row("username")

            'results.problemtype = reader("problemtype")
            'results.usernumber = reader("usernumber")

            results.requestok = False
            results.requestproblem = "Something's wrong"
        End If

        ' Else
        'results.requestok = False
        'results.requestproblem = "No Misc calls here dude"
        ' End If
        ' Catch e As Exception
        ' reportedexception(e, results)

        ' ' Finally
        ' If Not connection Is Nothing Then connection.Close()
        ' 'If Not reader Is Nothing Then reader.Close()

        ' End Try
        Return results
        ' End While
    End Function

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IE7 displays a blank page... thomasdrago XML 1 January 23rd, 2008 10:01 PM
Edit Query Results in Results Grid druid2112 SQL Server 2005 1 June 28th, 2007 08:49 AM
Report Displays Only One Record dlandolin Access 1 June 6th, 2007 12:18 PM
Crystal Report displays wrong value. shilpa_net2004 Crystal Reports 0 December 13th, 2005 04:30 AM
error message displays p2ptolu Classic ASP Databases 0 July 7th, 2005 04:27 AM

All times are GMT -4. The time now is 08:25 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.