Excel Connection Unspecified Error
Contents |
Tips/Tricks Top Articles Beginner Articles Technical Blogs Posting/Update Guidelines Article Help Forum Article Competition Submit an article or tip Post your Blog unspecified error while opening oledb connection quick answersQ&A Ask a Question View Unanswered Questions View All Questions... system.data.oledb.oledbexception unspecified error excel C# questions Linux questions ASP.NET questions SQL questions VB.NET questions discussionsforums All Message Boards... Application Lifecycle> Running unspecified error while opening excel connection a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI
Oledbconnection Open Unspecified Error
C# Free Tools Objective-C and Swift Database Hardware & Devices> System Admin Hosting and Servers Java .NET Framework Android iOS Mobile SharePoint Silverlight / WPF Visual Basic Web Development Site Bugs / Suggestions Spam and Abuse Watch features Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase Research Library CodeProject Stuff communitylounge unspecified error while opening oledb connection in c# Who's Who Most Valuable Professionals The Lounge The Insider News The Weird & The Wonderful The Soapbox Press Releases Non-English Language > General Indian Topics General Chinese Topics help What is 'CodeProject'? General FAQ Ask a Question Bugs and Suggestions Article Help Forum Site Map Advertise with us About our Advertising Employment Opportunities About Us Ask a Question All Questions All Unanswered FAQ Reading Excel File(.xls): Unspecified Error Rate this: Please Sign up or sign in to vote. See more: C# .NET MS-Excel Errors Hello All, I have an application that reads an excel file(.xls) but occasionally an error is thrown: Unspecified Error. I use an OleDbConnection to open a connection. OleDbCommand to execute a query. And DbDataReader to read the rows. My program logic is like this: 1. Open the excel file 2. Read each row 3. Validate each column - some validation may require opening the connection again 4. Save it to the database when no errors occur When I upload a
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and system.data.oledb.oledbexception unspecified error excel upload policies of this site About Us Learn more about Stack Overflow the
Unspecified Error Excel Upload Asp Net
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Adodb.connection Open Unspecified Error
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only http://www.codeproject.com/Questions/226156/Reading-Excel-File-xls-Unspecified-Error takes a minute: Sign up OLEDBConnection.Open() generates 'Unspecified error' up vote 2 down vote favorite 1 I have an application that uploads an Excel .xls file to the file system, opens the file with an oledbconnection object using the .open() method on the object instance and then stores the data in a database. The upload and writing of the file to http://stackoverflow.com/questions/96150/oledbconnection-open-generates-unspecified-error the file system works fine but I get an error when trying to open the file on our production server only. The application works fine on two other servers (development and testing servers). The following code generates an 'Unspecified Error' in the Exception.Message. Quote: System.Data.OleDb.OleDbConnection x = new System.Data.OleDb.OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + location + ";Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'"); try { x.Open(); } catch (Exception exp) { string errorEmailBody = " OpenExcelSpreadSheet() in Utilities.cs. " + exp.Message; Utilities.SendErrorEmail(errorEmailBody); } :End Quote The server's c:\\temp and c:\Documents and Settings\\aspnet\local settings\temp folder both give \aspnet full control. I believe that there is some kind of permissions issue but can't seem to find any difference between the permissions on the noted folders and the folder/directory where the Excel file is uploaded. The same location is used to save the file and open it and the methods do work on my workstation and two web servers. Windows 2000 SP4 servers. c# debugging connection-string xls oledbconnection share|improve this question edited Nov 18 '15 at 16:11 pnuts 33.8k63769 asked Sep 18 '08 at 19:41 Mike Smith 19113 add a comm
SQL Server 2014 Express resources Windows Server 2012 resources Programs MSDN subscriptions Overview Benefits Administrators Students Microsoft Imagine Microsoft Student Partners ISV Startups TechRewards Events Community Magazine https://social.msdn.microsoft.com/Forums/en-US/58b30013-453e-4418-a256-292436524500/intermittent-issue-oledbconnectionopen-throws-systemdataoledboledbexception-unspecified?forum=adodotnetdataproviders Forums Blogs Channel 9 Documentation APIs and reference Dev centers Retired content Samples We’re sorry. The content you requested has been removed. You’ll be auto redirected in 1 second. Ask a question Quick access Forums home Browse forums users FAQ Search related threads Remove From My Forums Answered by: Intermittent Issue - OleDbConnection.Open() throws unspecified error System.Data.OleDb.OleDbException: Unspecified error Data Platform Development > ADO.NET Managed Providers Question 0 Sign in to vote Aproduction application in our organization uses Excel 2003 files to handle user submitted data through a web application. This application works reliably most of the time. Recently, the application has begun intermittently throwing "System.Data.OleDb.OleDbException: Unspecified error" when the OleDbConnection.Open() unspecified error while method is called. The error continues until the application pool is recycled, at which time everything functions as expected again. No errors are captured within the Windows Application event log. The ASP.NET web application is hosted within web parts in WSS 3.0 on a Windows Server 2003 32 bit machine. Any insight would be much appreciated. We are using the following code to retrieve data from an Excel 2003 file: public static DataTable GetWorksheetData(string filePath) { OleDbConnectionStringBuilder builder = new OleDbConnectionStringBuilder { DataSource = filePath }; builder.Provider = "Microsoft.Jet.OLEDB.4.0"; builder["Extended Properties"] = "Excel 8.0;IMEX=1;HDR=YES"; DataTable table = new DataTable(); try { // Creates an OleDbConnection for the excel file using (OleDbConnection connection = new OleDbConnection(builder.ConnectionString)) { connection.Open(); string sheetName = GetWorksheet(connection, "Template"); if (!string.IsNullOrEmpty(sheetName)) { using (OleDbCommand command = connection.CreateCommand()) { try { command.CommandText = string.Format("SELECT * FROM [{0}]", sheetName); using (OleDbDataAdapter adapter = new OleDbDataAdapter(command)) using (DataSet dataSet = new DataSet()) { adapter.Fill(dataSet); table = dataSet.Tables[0]; } } finally { connection.Clo