XML Feed Dotnet

C

csgraham74

Hi Guys,

hopefully someone can help me with an issue. I have recenlty linked to
third party to receive data in XML format which i then want to display
on my site. The provider supplies a large amount of data which i want
to be able to search on the various fields using a web form (drop downs
etc) i then want to display the appropriate results of the search in a
datagrid. i need to search on price (greater than and less than) and
on a free text search

I have the part where i populate the dataset but how do i search within
a dataset ???? is this even possible ?? An idea was to populate my
database table with the data but i would have to do this every time and
therefore this would slow down my application.

any hints, tips or advice greatly appreciated.

Regards,

CG
 
C

csgraham74

Thanks Ken that was helpful,

im currently using the following code to populate my dataset.

If Cache("cch_Dataset") Is Nothing Then
xmlFeed =
DirectCast(WebRequest.Create("http://www.anylink.com"), HttpWebRequest)
xmlData = New DataSet


xmlData.ReadXml(xmlFeed.GetResponse().GetResponseStream())
Cache("cch_Dataset") = xmlData
Response.Write("<img name=IMAGE
src=http://www.anylink.com//" &
Trim(xmlData.Tables(0).Rows(0).Item("i1") & " width=120 height=76
border=0>"))

Response.Write(Trim(xmlData.Tables(0).Rows(0).Item("textdetail")))
End If



there is a time lag of between 10 - 15 seconds before the data is
pulled in and displayed on the load event, other sites that use the
same third party dont appear to have any time lag. is this the best
way to do it ????

what other options do i have - i think other sites do it almost
instantly.


Any help appreciated.

Cg

Hi CG,

Once you've got the data in a dataset, use the DataView's RowFilter property
to filter down to the parts you want. You just create an expression that
acts somewhat like a SQL query of the datatable.

dv.RowFilter = "City = 'Berlin'"


http://msdn.microsoft.com/library/d...rlrfsystemdatadataviewclassrowfiltertopic.asp

http://msdn.microsoft.com/library/d...fsystemdatadatatableclassdefaultviewtopic.asp

Ken
Microsoft MVP [ASP.NET]


csgraham74 said:
Hi Guys,

hopefully someone can help me with an issue. I have recenlty linked to
third party to receive data in XML format which i then want to display
on my site. The provider supplies a large amount of data which i want
to be able to search on the various fields using a web form (drop downs
etc) i then want to display the appropriate results of the search in a
datagrid. i need to search on price (greater than and less than) and
on a free text search

I have the part where i populate the dataset but how do i search within
a dataset ???? is this even possible ?? An idea was to populate my
database table with the data but i would have to do this every time and
therefore this would slow down my application.

any hints, tips or advice greatly appreciated.

Regards,

CG
 
K

Ken Cox - Microsoft MVP

Hi CG,

That doesn't look like a very efficient way of getting the XML data but it
is hard to tell from the snippet what you're received and from where.

What does the XML look like that you're using?

You might be better off using an XQuery to pick out the part(s) you want.

Ken
Microsoft MVP [ASP.NET]

csgraham74 said:
Thanks Ken that was helpful,

im currently using the following code to populate my dataset.

If Cache("cch_Dataset") Is Nothing Then
xmlFeed =
DirectCast(WebRequest.Create("http://www.anylink.com"), HttpWebRequest)
xmlData = New DataSet


xmlData.ReadXml(xmlFeed.GetResponse().GetResponseStream())
Cache("cch_Dataset") = xmlData
Response.Write("<img name=IMAGE
src=http://www.anylink.com//" &
Trim(xmlData.Tables(0).Rows(0).Item("i1") & " width=120 height=76
border=0>"))

Response.Write(Trim(xmlData.Tables(0).Rows(0).Item("textdetail")))
End If



there is a time lag of between 10 - 15 seconds before the data is
pulled in and displayed on the load event, other sites that use the
same third party dont appear to have any time lag. is this the best
way to do it ????

what other options do i have - i think other sites do it almost
instantly.


Any help appreciated.

Cg

Hi CG,

Once you've got the data in a dataset, use the DataView's RowFilter
property
to filter down to the parts you want. You just create an expression that
acts somewhat like a SQL query of the datatable.

dv.RowFilter = "City = 'Berlin'"


http://msdn.microsoft.com/library/d...rlrfsystemdatadataviewclassrowfiltertopic.asp

http://msdn.microsoft.com/library/d...fsystemdatadatatableclassdefaultviewtopic.asp

Ken
Microsoft MVP [ASP.NET]


csgraham74 said:
Hi Guys,

hopefully someone can help me with an issue. I have recenlty linked to
third party to receive data in XML format which i then want to display
on my site. The provider supplies a large amount of data which i want
to be able to search on the various fields using a web form (drop downs
etc) i then want to display the appropriate results of the search in a
datagrid. i need to search on price (greater than and less than) and
on a free text search

I have the part where i populate the dataset but how do i search within
a dataset ???? is this even possible ?? An idea was to populate my
database table with the data but i would have to do this every time and
therefore this would slow down my application.

any hints, tips or advice greatly appreciated.

Regards,

CG
 
C

csgraham74

Thanks Ken,

I didnt think it was very efficient either but i have no experinece of
this type transfer.

I was looking into XQuery lat night but didnt get very far with it
mainly due to tiredness.

In terms of a search form do i then write my xQuery code then return
that data and populate my dataset that way?? is the best way to
transfer the data by using the GetResponseStream - is this efficient ??

by the way are there any good tutorials on XQuery ???


thanks for all ur help

C

Hi CG,

That doesn't look like a very efficient way of getting the XML data but it
is hard to tell from the snippet what you're received and from where.

What does the XML look like that you're using?

You might be better off using an XQuery to pick out the part(s) you want.

Ken
Microsoft MVP [ASP.NET]

csgraham74 said:
Thanks Ken that was helpful,

im currently using the following code to populate my dataset.

If Cache("cch_Dataset") Is Nothing Then
xmlFeed =
DirectCast(WebRequest.Create("http://www.anylink.com"), HttpWebRequest)
xmlData = New DataSet


xmlData.ReadXml(xmlFeed.GetResponse().GetResponseStream())
Cache("cch_Dataset") = xmlData
Response.Write("<img name=IMAGE
src=http://www.anylink.com//" &
Trim(xmlData.Tables(0).Rows(0).Item("i1") & " width=120 height=76
border=0>"))

Response.Write(Trim(xmlData.Tables(0).Rows(0).Item("textdetail")))
End If



there is a time lag of between 10 - 15 seconds before the data is
pulled in and displayed on the load event, other sites that use the
same third party dont appear to have any time lag. is this the best
way to do it ????

what other options do i have - i think other sites do it almost
instantly.


Any help appreciated.

Cg

Hi CG,

Once you've got the data in a dataset, use the DataView's RowFilter
property
to filter down to the parts you want. You just create an expression that
acts somewhat like a SQL query of the datatable.

dv.RowFilter = "City = 'Berlin'"


http://msdn.microsoft.com/library/d...rlrfsystemdatadataviewclassrowfiltertopic.asp

http://msdn.microsoft.com/library/d...fsystemdatadatatableclassdefaultviewtopic.asp

Ken
Microsoft MVP [ASP.NET]


Hi Guys,

hopefully someone can help me with an issue. I have recenlty linked to
third party to receive data in XML format which i then want to display
on my site. The provider supplies a large amount of data which i want
to be able to search on the various fields using a web form (drop downs
etc) i then want to display the appropriate results of the search in a
datagrid. i need to search on price (greater than and less than) and
on a free text search

I have the part where i populate the dataset but how do i search within
a dataset ???? is this even possible ?? An idea was to populate my
database table with the data but i would have to do this every time and
therefore this would slow down my application.

any hints, tips or advice greatly appreciated.

Regards,

CG
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top