ASP.NET Import/Export
-
Hi, I would like to have a asp.net application that will let me extract or import data automatically to my Access Database. For that, I have a .csv file and I will then upload it and will be extracted into one of the table in my Access Database. Is there any feauture that ASP.NET can easily do? Is "IO" related to this? Could anyone poiunt out any feautures that will help me do this?
-
Hi, I would like to have a asp.net application that will let me extract or import data automatically to my Access Database. For that, I have a .csv file and I will then upload it and will be extracted into one of the table in my Access Database. Is there any feauture that ASP.NET can easily do? Is "IO" related to this? Could anyone poiunt out any feautures that will help me do this?
You could always use classes in the
System.IO
namespace to read the .csv file as a text file, parse it yourself, and execute INSERT commands through an OleDb connection. I think you can also read the source .csv file using its own OleDb connection, with something like this for the connection string:"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\myCsvFile.csv;Extended Properties=Text;"
You might want to check http://www.connectionstrings.com[^] as a good general reference on connection string construction. You might also just Google for stuff like "import csv C#" or "import csv VB.NET" - in fact, you'll come up with some CodeProject articles on the topic that way.