Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel File Into DataSet
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
01451119
Message ID:
01451121
Vues:
31
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform