Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9094543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:22:25+00:00 2026-06-16T23:22:25+00:00

I need to return some data from a web service that looks something like

  • 0

I need to return some data from a web service that looks something like this:

data.page = 1
data.count = 12883
data.rows(0).id = 1
data.rows(0).name = "bob"
data.rows(1).id = 2
data.rows(1).name = "steve"
data.rows(2).id = 3
data.rows(2).name = "fred"

I have no idea how to do this. I’ve returend simple types and simple arrays, but never an object like this.

The data source is a sql Database. The target is a javascript/ajax function. I’m currently successfully returning the rows themselves as a dataset and it works, but I need to add the count and a couple other “parent level” variables.

For the sake of full disclosure, here is the code that is working:

<WebMethod()> _
Public Function rptPendingServerRequests() As DataSet
    Dim connetionString As String
    Dim connection As SqlConnection
    Dim command As SqlCommand
    Dim adapter As New SqlDataAdapter
    Dim ds As New DataSet
    Dim sql As String

    connetionString = "..."
    sql = "SELECT usm_request.request_id, usm_request.status, usm_request.req_by_user_id " +
        "FROM usm_request " +
        "WHERE usm_request.request_id in " +
        "(SELECT distinct(usm_request.request_id) from usm_request, usm_subscription_detail WHERE usm_request.request_id = usm_subscription_detail.request_id " +
        "AND usm_subscription_detail.offering_id = 10307) ORDER BY usm_request.request_id DESC"
    connection = New SqlConnection(connetionString)

    Try
        connection.Open()
        command = New SqlCommand(sql, connection)
        adapter.SelectCommand = command
        adapter.Fill(ds)
        adapter.Dispose()
        command.Dispose()
        connection.Close()

        Return ds

    Catch ex As Exception
    End Try
End Function

And I’m trying to consume it with FlexiGrid. I’ve been working at it for a few hours with no luck. I basically need to convert the PHP at the following site to .net

http://code.google.com/p/flexigrid/wiki/TutorialPropertiesAndDocumentation

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:22:26+00:00Added an answer on June 16, 2026 at 11:22 pm

    I think that you would be much better off just creating a couple of classes and moving the data from the database into these classes. For example:

    Public Class MyDataClass
        Public Property Page As Integer
    
        Public ReadOnly Property Count As Integer
            Get
                If Me.Rows IsNot Nothing Then
                    Return Me.Rows.Count
                Else
                    Return 0
                End If
            End Get
        End Property
    
        Public Property Rows As List(Of MyDataRow)
    
        ' Parameterless constructor to support serialization.
        Public Sub New()
            Me.Rows = New List(Of MyDataRow)
        End Sub
        Public Sub New(wPage As Integer, ds As DataSet)
            Me.New()
    
            Me.Page = wPage
    
            For Each oRow As DataRow In ds.Tables(0).Rows
                Dim oMyRow As New MyDataRow
    
                oMyRow.Id = oRow("id")
                oMyRow.Name = oRow("Name")
    
                Me.Rows.Add(oMyRow)
            Next
        End Sub
    End Class
    
    Public Class MyDataRow
        Public Property Id As Integer
        Public Property Name As String
    
        ' Parameterless constructor to support serialization
        Public Sub New()
    
        End Sub
    End Class
    

    Then change the return type of the method to MyDataClass and change the return to:

            Return New MyDataClass(1, ds)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need to consume some data from a web service that requires a username/password for
I need to create a web service that returns XML data to some of
I have a .net web service that takes some xml data. From within the
I'm trying to write a WCF Web service that will return my data as
I'm having some trouble with transfering data from and to my web service from
I need to access the response from a .NET web service which returns data
i have this code: def some_method(): #i need to get some attrs :( return
I'm receiving data from web-services in XML and I'm using that data via objects,
I need to provide (to myself) a way to grab some data from the
(Following up on this question: Getting raw XML response from Java web service client

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.