Sunday, October 23, 2005


public DataSet
GetCSVFile( string fileName)
{
     string pathName = System.IO. Path .GetDirectoryName(fileName);
     string file = System.IO. Path .GetFileName(fileName);
     OleDbConnection excelConnection = new OleDbConnection
     (@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ pathName + ";Extended Properties=Text;");
     OleDbCommandexcelCommand = newOleDbCommand(@"SELECT * FROM "+ file, excelConnection);
     OleDbDataAdapterexcelAdapter = newOleDbDataAdapter(excelCommand);
     excelConnection.Open();
     DataSetds = newDataSet();
     excelAdapter.Fill(ds);
     excelConnection.Close();
     return ds;
}

10/23/2005 10:48:42 AM (Mitteleuropäische Sommerzeit , UTC+02:00)
cool code... ;-)
s.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):