Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel To DataSet Not Working
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Excel To DataSet Not Working
Miscellaneous
Thread ID:
01454334
Message ID:
01454334
Views:
86
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
Next
Reply
Map
View

Click here to load this message in the networking platform