asp.net连接Excel字符串。

解决方案 »

  1.   


    http://www.connectionstrings.com/Standard:"Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\MyExcel.xls;DefaultDir=c:\mypath;" 
    TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed by a "$" and wrapped in "[" "]" brackets.
     OLE DB 
     Standard:"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" 
    "HDR=Yes;" indicates that the first row contains columnnames, not data
    "IMEX=1;" tells the driver to always read "intermixed" data columns as text
    TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed by a "$" and wrapped in "[" "]" brackets.
      

  2.   

    string strConn;
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
    "Data Source=C:\\Inetpub\\wwwroot\\contacts.xls;"+
    "Extended Properties=Excel 8.0;";
    OleDbConnection conn = new OleDbConnection(strConn);
      

  3.   

    http://www.yesky.com/20011004/199785.shtml
      

  4.   

    推荐本书:app.net200问要什么有什么,我买了,很好。你的问题上面有的答,可惜我还没看到那!
    *_*