How can I bind the results of Web service to a ListView?

Discussion in 'ASP .Net' started by artist, Jul 12, 2010.

  1. artist

    artist Guest

    Hi all,

    I'm new to ASP.NET so I apologize if this is a basic question.

    I have a Web application. This web application has a ListView on it.
    For this web app I make calls to a web service which returns data from a
    database. I return the data using the following format:


    [WebMethod]
    public List<Record> Search()
    {
    List<Record> list = new List<Record>();
    /* Populate list with data from a db */
    return list;
    }

    public class Record
    {
    public String name;
    public String address;
    public int ageInYears;
    }

    Now I would like from the Web Application to show the data on a
    listview. Is there a way of doing this by using the Data Source property
    of the Listview or the only way is to populate the listview manually?

    Thanks a lot
    artist, Jul 12, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,593
    mr2_93
    Oct 2, 2005
  2. shapper

    ListView Bind

    shapper, Nov 18, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    338
    shapper
    Nov 18, 2007
  3. Ken Fine
    Replies:
    3
    Views:
    530
    Steven Cheng [MSFT]
    Jul 23, 2008
  4. Jeremy S
    Replies:
    4
    Views:
    8,953
    Jeremy S.
    Jul 15, 2009
  5. .
    Replies:
    0
    Views:
    720
Loading...

Share This Page