oledbconnection

Dapper And System.Data.OleDb DbType.Date throwing 'OleDbException : Data type mismatch in criteria expression'

天大地大妈咪最大 提交于 2019-12-23 18:43:10
问题 Not sure if I should raise an issue regarding this, so thought I would ask if anybody knew a simple workaround for this first. I am getting an error when I try to use Dapper with OleDbConnection when used in combination with MS Access 2003 (Jet.4.0) (not my choice of database!) When running the test code below I get an exception 'OleDbException : Data type mismatch in criteria expression' var count = 0; using (var conn = new OleDbConnection(connString)) { conn.Open(); var qry = conn.Query

OLEDBConnection.Open() generates 'Unspecified error'

旧城冷巷雨未停 提交于 2019-12-22 10:54:01
问题 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 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

System.Data.OleDb.OleDbConnectionInternal..ctor: Unspecified error

假如想象 提交于 2019-12-22 05:22:14
问题 After several hours (~6 hours Win7 64bit, ~24hours WinXP) of running multi-threaded (.NET Framework 3.5 SP1 WinForms) desktop application using .mdb files as backend I'm getting the following runtime error: Exception -> Unspecified error StackTrace -> at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool

Unrecognized database format accdb in visual studio

三世轮回 提交于 2019-12-21 05:22:37
问题 I am using visual studio community 2017 Access 2010 - 2016 I can import an access file I created File sent from client contains(tables, queries, forms, macros, and modules) Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\jeremiah\Documents\Batching.accdb Client sent me another basic file, was able to open without a problem So I been through all current stack over flow solutions for people reporting the unrecognized database error and none of them have been useful. My only theory is

OleDBException error INSERT

99封情书 提交于 2019-12-20 03:04:14
问题 I build a c# application where you can login and can register a new account. But when I click on my button new account, and fill in the required fields I will get the following error: vcom.ExecuteNonQuery(); -> OleDBException was unhandled. The instruction INSERT contains a syntaxerror. See here below our code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms;

Can we add Reference of 'Microsoft.ACE.Oledb.12.0.dll' to project

旧城冷巷雨未停 提交于 2019-12-18 13:27:42
问题 I am getting error "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." on my testing servers. So My Question is : i) Can i add reference for "'Microsoft.ACE.Oledb.12.0.dll'" to project it self? ii) Is it safe? iii) How to do this? Every thing is working on my local machine since i have latest version of office install in my machine. As soon as i am deploying my code to testing servers i am getting above error. I might not be able to install Office on testing

SSIS Package Not Running as 32bit in SQL Server 2012

百般思念 提交于 2019-12-17 13:59:46
问题 I have a package that I developed in VS2012 (using the SQL Data Tools component) which collects data from a DBF file using the VFPOLEDB provider, and puts it into a database on a SQL Server 2012 X64 server. The project containing the package has the DebugOption of Run64BitRuntime set to false. I have imported this package to the SSIS Package Store of a test and live server (identical setups). The VFPOLEDB provider is installed on both, and I can see in the registry of both machines that it's

SQLCommand/SQLConnection vs OleDbCommand/OleDbConnection

倖福魔咒の 提交于 2019-12-14 00:55:42
问题 Does it make a difference whether I use SQLCommand / SQLConnection instead of OleDbCommand / OleDbConnection . Do I get any advantages out of that, from a API comfortability, feature, performance or security perspective? Or any other perspective? 回答1: OleDbCommand and OleDbConnection are general. SqlCommand and SqlConnection are specific to SQL Server, and can take advantage of its features. They also expose the features of SQL Server. For instance, you can use them to manipulate XML columns.

OleDbCommand using wrong path

六眼飞鱼酱① 提交于 2019-12-13 19:40:53
问题 I have the following c# code in a WPF app: var command = new OleDbCommand($"CREATE INDEX idx{index.ColumnName} ON {tableConfig.Name}({index.ColumnName})", _targetCon); try { command.ExecuteNonQuery(); } catch (Exception ex1) { _serilog.WriteError(METHOD_NAME, "Trouble adding index onto Access column", ex1); } My problem is that when stepping through the code in the VS debugger, the line "command.ExecuteNonQuery();" is throwing an exception. At the time of the exception, the value of

OleDb Connection not reading all the rows from excel file

二次信任 提交于 2019-12-13 14:32:23
问题 I am using an OleDb in C# connection to read data from an Excel sheet. And fill it in a Datatable. The sheet contains 275 rows and 27 columns. After I read it, Rows 1,2 and 3 are empty. All the other rows are filled correctly. Anyone have an idea on the problem? Here is my code: string connString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + "C:/Sheets/DataSheet.xls" + ";Extended Properties=Excel 12.0;"; objConn = new OleDbConnection(connString); string Query = "SELECT * FROM