Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

mid_life_crisis

@mid_life_crisis
About
Posts
5
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C# read of xls file works on Vista home premium but not XP Pro, Vista Business or 2003 server. [modified]
    M mid_life_crisis

    I just tried the path suggestion. I changed the path to "C:\\csharpdata\\Daily_Totals_By_Employee.xls". No change. At the risk of being obtuse, I don't understand how permissions could be the problem. I'm not saying you're all wrong, just that I don't understand it. The file is being opened: wouldn't a permissions issue prevent that? The program opens the file then fails to find the sheet.

    C# csharp help database sysadmin business

  • C# read of xls file works on Vista home premium but not XP Pro, Vista Business or 2003 server. [modified]
    M mid_life_crisis

    This is all the relevant code. I just don't get why it would work for the one system but not the others. string filename = "C:\\Program files\\Daily_Totals_By_Employee.xls"; string listname = "Sheet1"; OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";Extended Properties = 'Excel 8.0'"); con.Open(); try { DataSet myDataSet = new DataSet(); OleDbDataAdapter myCommand = new OleDbDataAdapter(" SELECT * FROM [" + listname + "$]", con); myCommand.Fill(myDataSet); con.Close();

    C# csharp help database sysadmin business

  • C# read of xls file works on Vista home premium but not XP Pro, Vista Business or 2003 server. [modified]
    M mid_life_crisis

    Darn! Still no good. It makes no sense to me. Why fine on one but not on others? I used to say that I liked programming because of the instant gratification when you compile an app and it works, but this is an example of the dark counterpoint to that. Instant frustration.

    C# csharp help database sysadmin business

  • C# read of xls file works on Vista home premium but not XP Pro, Vista Business or 2003 server. [modified]
    M mid_life_crisis

    You are correct. Filename is a variable holding the full path of the actual file, and sheet1 does exist in all cases, as in each instance, I have copied the file from one to another. What is the "IMEX=1" all about?

    C# csharp help database sysadmin business

  • C# read of xls file works on Vista home premium but not XP Pro, Vista Business or 2003 server. [modified]
    M mid_life_crisis

    These are the relevent lines from the code. The same file is being opened, the problem is that the program can't find the sheet when running under XPPRo, 2003 server, or Vista Business. All computers are up to date with the latest .net installed, all have Excel 2003 with current updates. Any ideas? string listname = "Sheet1"; OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";Extended Properties=Excel 8.0"); con.Open(); try { DataSet myDataSet = new DataSet(); OleDbDataAdapter myCommand = new OleDbDataAdapter(" SELECT * FROM [" + listname + "$]", con); myCommand.Fill(myDataSet); All Systems have Excel 2003 SP3 I get an error message on the failures: System.Data.OleDbException: The Microsoft Jet database engine could not find the object 'Sheet1$'

    modified on Tuesday, February 17, 2009 12:14 PM

    C# csharp help database sysadmin business
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups