Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel File Into DataSet
Message
 
To
25/02/2010 19:48:33
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01451119
Message ID:
01451121
Views:
30
>>I'm reading an Excel file into a DataSet. The file has multiple date columns. In the DS the first date columns appears as it should.
>>The remaining date columns are empty.
>>
>>I checked the Excel file and all date columns are formmated as Dates.
>>
>>Anyone have any idea what's wrong here?
>
>How are you importing this data?

Like this:
private static DataSet _GetExcelDS()
{
    string SourceFile = @"C:\Projects\InvTrack\Data\SourceData.xls";
    DataAccess da = new DataAccess();
    da.ProviderInvariantName = "System.Data.OleDb";
    da.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + SourceFile + ";Extended Properties=Excel 8.0;";

    DataSet dsRetVal = da.ExecuteQuery("select * from [invdata$]", CommandType.Text);

    return dsRetVal;
}
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform