Importing remote http excel file as datasource?
Hi,
Firstly I'm new. New to everything... including this forum, programming in C#, object orientated programming as a concept and indeed visual studio.
Last week I built my first C# windows form program, basically reading information from a MySql database and organising it into several Listviews with certain controls.
Now I'm trying something different which the last hour of Googling hasn't helped with.
There is a remotely stored excel file (CSV) which I want to read from a Windows Form and eventually upload to a MySql database. I think I should be ok with the upload part, it's remotely connecting to this file and getting initial parsing of the data which is the issue.
I've been succesful in configuring a local excel file on my machine as a datasource through the Visual Studio interface but have drawn a blank when trying to do it remotely. Any one any tips or ideas?
P.S. I will come back with silly questions later, go easy.
Michael ReidPosted Dec 11, 2009, 6:42 AM
Sam HobbsPosted Nov 30, 2009, 11:53 AM
If the CSV file is accessible over the internet, then Kirtan answered the question. If the file is not accessible that way, then you need to be more specific.
Kirtan PatelPosted Nov 30, 2009, 8:35 AM
you can download file in Local Folder using Web Client Class and Perform Parsing Task like below
using System.Net;
WebClient wc = new WebClient();
wc.DownloadFile("http://sample.com/xyz.csv", "data.scv");
//Now Perform the operations on data.csv
then Read the File using ADO.net and perform Operations :)
if my idea helps you then check "Do you like this answer check box please :)