Can I convet a query from an API into a Datasource to bind to?

Discussion in 'ASP .Net Datagrid Control' started by Paul D. Fox, Sep 9, 2005.

  1. Paul D. Fox

    Paul D. Fox Guest

    I have some sample code that queries through a products API. I'd like to convert this sample into a Datasource that I can bind to a Datagrid (instead of using the Console.WriteLine), but not sure as to how. Can anyone help? Here's the sample:

    For i = 0 To queryResults.GetRowCount - 1
    Dim document As IObjectQueryRow = queryResults.GetRow(i)
    'Print out standard properties
    Console.WriteLine("Document: " + document.GetName())
    Console.WriteLine("Created: " + document.GetCreated())
    Console.WriteLine("Last Modified: " + document.GetLastModified())
    Console.WriteLine("Description: " + document.GetDescription())

    Console.WriteLine("Description: " + document.

    'Print out a Document-specific property
    Console.WriteLine("Located at URL:" + document.GetStringValue(DocumentProperty.URL))
    Next

    Paul
    Paul D. Fox, Sep 9, 2005
    #1
    1. Advertising

  2. Paul,

    Create a typed dataset with a table structured as the rows you are getting from the API. The VS will create a source code file with types, properties and methods facilitating access to the dataset. You can use this automatically created code to fill up the dataset. Then bind the dataset to the datagrid.


    Eliyahu

    "Paul D. Fox" <> wrote in message news:...
    I have some sample code that queries through a products API. I'd like to convert this sample into a Datasource that I can bind to a Datagrid (instead of using the Console.WriteLine), but not sure as to how. Can anyone help? Here's the sample:

    For i = 0 To queryResults.GetRowCount - 1
    Dim document As IObjectQueryRow = queryResults.GetRow(i)
    'Print out standard properties
    Console.WriteLine("Document: " + document.GetName())
    Console.WriteLine("Created: " + document.GetCreated())
    Console.WriteLine("Last Modified: " + document.GetLastModified())
    Console.WriteLine("Description: " + document.GetDescription())

    Console.WriteLine("Description: " + document.

    'Print out a Document-specific property
    Console.WriteLine("Located at URL:" + document.GetStringValue(DocumentProperty.URL))
    Next

    Paul
    Eliyahu Goldin, Sep 11, 2005
    #2
    1. Advertising

  3. Paul D. Fox

    Paul D. Fox Guest

    I'm not quite following you. Do you have an example I can start with?

    Paul
    "Eliyahu Goldin" <> wrote in message news:...
    Paul,

    Create a typed dataset with a table structured as the rows you are getting from the API. The VS will create a source code file with types, properties and methods facilitating access to the dataset. You can use this automatically created code to fill up the dataset. Then bind the dataset to the datagrid.


    Eliyahu

    "Paul D. Fox" <> wrote in message news:...
    I have some sample code that queries through a products API. I'd like to convert this sample into a Datasource that I can bind to a Datagrid (instead of using the Console.WriteLine), but not sure as to how. Can anyone help? Here's the sample:

    For i = 0 To queryResults.GetRowCount - 1
    Dim document As IObjectQueryRow = queryResults.GetRow(i)
    'Print out standard properties
    Console.WriteLine("Document: " + document.GetName())
    Console.WriteLine("Created: " + document.GetCreated())
    Console.WriteLine("Last Modified: " + document.GetLastModified())
    Console.WriteLine("Description: " + document.GetDescription())

    Console.WriteLine("Description: " + document.

    'Print out a Document-specific property
    Console.WriteLine("Located at URL:" + document.GetStringValue(DocumentProperty.URL))
    Next

    Paul
    Paul D. Fox, Sep 13, 2005
    #3
    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. =?Utf-8?B?S2VubmV0aA==?=

    Easiest way to bind a grid datasource to a datatable

    =?Utf-8?B?S2VubmV0aA==?=, Jan 18, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    6,726
    =?Utf-8?B?S2VubmV0aA==?=
    Jan 18, 2004
  2. Luke Dalessandro
    Replies:
    2
    Views:
    4,549
    Luke Dalessandro
    Sep 28, 2004
  3. =?Utf-8?B?bWltbw==?=

    Bind a Label to an object Datasource control

    =?Utf-8?B?bWltbw==?=, Jan 3, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,926
    =?Utf-8?B?bWltbw==?=
    Jan 3, 2006
  4. Kevin

    Object datasource bind problem

    Kevin, Aug 26, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    501
    Kevin
    Aug 26, 2006
  5. Phil Streiff
    Replies:
    3
    Views:
    901
    Teemu Keiski
    Apr 25, 2004
Loading...

Share This Page