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

  • SEARCH
  • Home
  • 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 7527409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:05:54+00:00 2026-05-30T04:05:54+00:00

i have this restful web service where i actually return a list<> in c#.

  • 0

i have this restful web service where i actually return a list<> in c#. Now i need to access it with jquery and ajax(this part done) what i haven’t and i couldn’t do is how to traverse the data and print it one by one on the jquery side. Any help will be much appreciated. UPDATE: having this code on my rest web service. Can you give me a sample code for the $.each function? because i can’t seem to make it work. THANK YOU.

       List<Inventory> IService1.GetInventory()
    {
        List<Inventory> list = new List<Inventory>(); using (SqlConnection testconn = new SqlConnection(connection))
        {
            if(testconn.State == ConnectionState.Closed)
            {
                testconn.Open();
            }

            using(SqlCommand testcmd = new SqlCommand("select * from inventoryitem",testconn))
            {
                SqlDataReader reader = testcmd.ExecuteReader();
                while( reader.Read())
                {
                    Inventory testObj = new Inventory();
                    testObj.InventoryName = reader["StandardCost"].ToString();
                    list.Add(testObj);
                }
            }
        }
        return list;
    }
  • 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-05-30T04:05:55+00:00Added an answer on May 30, 2026 at 4:05 am

    You should be able to Serialize it as JSON:

    http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.aspx

    Then iterate over it with an $.each() in jQuery.

    http://api.jquery.com/jQuery.each/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a RESTful web service and I want to access it from Android.
I have a RESTful web service running on Jersey (GlassFish 3.1.1). This one's a
I have a RESTful Web Service hosted in IIS 6.0, I am able to
I have a restful web service that generates two types of output based on
I have a RESTful web service and a rich client application using it. I
I have a RESTful web service deployed at http://example.com/v1/SomeResource . One day, a new
Assume I have a RESTful web service, which holds information about an object that
I have a simple RESTful web service that print Hello World ! I'm using
I am writing a RESTful web service where in I want to return a
I have implemented a generic handler to work as a restful web service in

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.