CSV (from URL) to DataSet ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to pull some data from a CSV URL (from yahoo's website) directly into
a DataSet.

Is there a way to do this without having to save the CSV file on disk ?


Thanks,
Yannick L.
 
You should be able to open a connection on the URL path and create a data
reader. While I have not done exactly this, I don't foresee any serious
issues. You might need to define an ODBC DSN or config file to define the
inbound data structure. Once the DataReader is open you can use the
DataTable.Load method to populate the DataTable.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
Yannick,

For sure you should be able to do this, however it depends if the XML file
is really a dataset (that is not forever).

You can get the page using HTTP see by instance the first part of this
sample. Ignore the MSHTML part.
http://www.vb-tips.com/dbpages.aspx?ID=541adf13-d9c0-435c-893f-56dbb63fdf1c

Than you can most probably deserialize your dataset
http://www.vb-tips.com/dbpages.aspx?ID=06d9730e-9e33-404c-947a-c891846eaf0b

I have never tried this by the way, if the last not go, there are also
methods by using the Memory Stream, however I have never tried those anymore
as there was in past a bug in the deserialize method of that.

Cor
 
Back
Top