Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel To DataSet Not Working
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Excel To DataSet Not Working
Divers
Thread ID:
01454334
Message ID:
01454334
Vues:
87
I am trying to load an Excel file into a DS. Not all columns are making into the DS. Some columns are empty. Anyone know why this is and what to do about it?
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "Excel Files (*.xls)|*.xls|All files (*.*)|*.*";
dialog.InitialDirectory = @"c:\";
dialog.Title = "Select an SQA file";
DialogResult Result = dialog.ShowDialog();

if(Result == DialogResult.OK)
{
    string FileName = dialog.FileName;
    DataAccess da = new DataAccess();
    da.ProviderInvariantName = "System.Data.OleDb";

    da.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FileName + ";" + "Extended Properties=Excel 8.0;";

    DataSet ds = da.ExecuteQuery("select * from [New Quote$]", CommandType.Text);
}
At this point, some columns in the DS are empty.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform