Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Can I convet a query from an API into a Datasource to bind to?

Reply
Thread Tools

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

 
 
Paul D. Fox
Guest
Posts: n/a
 
      09-09-2005
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
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      09-11-2005
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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
 
Reply With Quote
 
 
 
 
Paul D. Fox
Guest
Posts: n/a
 
      09-13-2005
I'm not quite following you. Do you have an example I can start with?

Paul
"Eliyahu Goldin" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object datasource bind problem Kevin ASP .Net 0 08-26-2006 09:48 AM
Bind a Label to an object Datasource control =?Utf-8?B?bWltbw==?= ASP .Net 0 01-03-2006 07:37 PM
ASP.NET 2.0 How-To: Bind datasource parameter to UserID? Luke Dalessandro ASP .Net 2 09-28-2004 06:49 PM
dropdownlist blues - can't bind datasource to datareader in codebehind Phil Streiff ASP .Net Web Controls 3 04-25-2004 02:56 PM
Easiest way to bind a grid datasource to a datatable =?Utf-8?B?S2VubmV0aA==?= ASP .Net 2 01-18-2004 12:16 PM



Advertisments