oledb

DataAdapter.Fill(Dataset)

社会主义新天地 提交于 2019-12-18 12:27:54
问题 i try to get some Data from a Access Database via OleDB in a DataSet . But the DataSet is empty after the Fill() method. The same statement works and return 1 row when i trigger them manually in D*. OleDbConnection connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Inventar.accdb"); DataSet1 DS = new DataSet1(); connection.Open(); OleDbDataAdapter DBAdapter = new OleDbDataAdapter( @"SELECT tbl_Computer.*, tbl_Besitzer.* FROM tbl_Computer INNER JOIN tbl_Besitzer ON

I get “Syntax error in UPDATE statement” with OleDB

偶尔善良 提交于 2019-12-18 09:46:56
问题 I am developing an information system that works with a connected data source / MS Access database. The question is kinda cliche but I can't seem to find a proper solution from the similar ones I have come across. Here is my code for the button. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'myConnection.ConnectionString = connString 'myConnection.Open() If Me.txtConfirmPasscode.Text = Me.txtNewPasscode.Text Then Dim updateCmd As

Trouble to open XLS file with oledb

非 Y 不嫁゛ 提交于 2019-12-18 09:34:01
问题 When I try to open an xls file, I get this error : Rhe Microsoft Office Access database engine cannot open or write to the file ''. It is already opened exclusively by another user, or you need permission to view and write its data. I do several access but I close and dispose the connection all the time. It's on my DEV PC. On the server I get this error : Don't have read/write access on the file. This file is on \networkdisk\directory1\Files I'll use "ACE.OLEDB" because Jet is not running on

Month name of date field in Access database from external application (C#)

╄→尐↘猪︶ㄣ 提交于 2019-12-18 09:11:32
问题 I want to populate a drop down list at runtime in C#. I have a Date/Time field (e.g., 01/05/2000) in an Access 2003 database. I want to have the month name (i.e. January, February, ...) in the drop down list at runtime. SELECT DISTINCT MonthName(Month(DATE_OF_BOOKING)) AS MNTH FROM TRAVEL_DETAILS WHERE YEAR(DATE_OF_BOOKING)='2008' The above query works fine while I'm running it from Access directly, but when I'm trying to run it from an OledbCommand object in C# it says Undefined function

OpenXML takes much longer than OLEDB to read rows from Excel sheet

落爺英雄遲暮 提交于 2019-12-18 07:18:34
问题 When I used OLEDB, it takes only 2 - 3 seconds to read 3200 rows from an Excel Sheet. I changed to the OpenXML format and now it takes more than 1 minute to read 3200 rows from an Excel Sheet. Below is my code: public static DataTable ReadExcelFileDOM(string filename) { DataTable table; using (SpreadsheetDocument myDoc = SpreadsheetDocument.Open(filename, true)) { WorkbookPart workbookPart = myDoc.WorkbookPart; Sheet worksheet = workbookPart.Workbook.Descendants<Sheet>().First();

Reading multiple excel sheets with different worksheet names

倖福魔咒の 提交于 2019-12-18 07:04:38
问题 I would like to know how I can read multiple excel worksheet with different worksheet name in c# and with the used of oledb. I have this existing way to read multiple sheets (but with fixed worksheet name): DataSet ds = new DataSet(); var excelConnectionString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Excel 8.0", path); OleDbConnection connection = new OleDbConnection(); connection.ConnectionString = excelConnectionString; var i = 1; while (i <= 4)

Read password protected excel file using OLEDB in C#

走远了吗. 提交于 2019-12-18 02:49:37
问题 In my c# application I am using OLEDB connection string " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\test.xls;Extended Properties=\"Excel 8.0;HDR=NO;ReadOnly=true;IMEX=1\" " to read Excel files. In order to read a password protected file I tried adding password field in connection string but was unable to read file. I want to know is there any way to read password protected Excel files using OLEDB if I know its password beforehand. 回答1: Here are different ways to connect to an Excel file

Connecting to ACCDB format MS-ACCESS database through OLEDB

时光怂恿深爱的人放手 提交于 2019-12-18 02:47:35
问题 I've recently made another question about connecting to MS-ACCESS database with .NET in C# or VB.NET. It worked just as intended with MDB, but with accdb it caused an exception in conn.Open(); which follows: alt text http://dl.dropbox.com/u/3045472/accdb_fail.png Is there another way to do this? My original intention (like stated in the original question) is gathering some (actually, a lot of) fields. 回答1: Use ACE 4 driver, download it here then use following connection string: "Provider

Microsoft.ACE.OLEDB.12.0 Provider can no longer open .mdb under Windows 8

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 02:47:28
问题 I have an x64 application which uses Microsoft.ACE.OLEDB.12.0 provider to read an MS Access Database on Windows 7 (x64) and it works fine (Office 2010 installed). The same application running under Windows 8 with Office 2013 installed, fails with a message saying that the provider cannot open previous versions. Under Windows 8 with Office 2013 installed, there is also Microsoft.ACE.OLEDB.15.0, but I have double checked my code and certain that it is specifying the 12.0 in the connection

Microsoft.ACE.OLEDB.12.0 Provider can no longer open .mdb under Windows 8

守給你的承諾、 提交于 2019-12-18 02:47:09
问题 I have an x64 application which uses Microsoft.ACE.OLEDB.12.0 provider to read an MS Access Database on Windows 7 (x64) and it works fine (Office 2010 installed). The same application running under Windows 8 with Office 2013 installed, fails with a message saying that the provider cannot open previous versions. Under Windows 8 with Office 2013 installed, there is also Microsoft.ACE.OLEDB.15.0, but I have double checked my code and certain that it is specifying the 12.0 in the connection