oledb

I am getting an error when I try to update records in my access database

自作多情 提交于 2020-01-05 04:41:17
问题 I have a small program that connects to an access database, and what I am trying to do is update(edit) a selected record via an edit form. When I execute my code, I get this error: System.Data.OleDb.OleDbException was unhandled Message=Syntax error (missing operator) in query expression '5346 S. Eubank blvd'. Source=Microsoft Access Database Engine ErrorCode=-2147217900 Needless to say, it is for the Address field.. Here is my code block: private void saveChangeBtn_Click(object sender,

Using Parameters with OleDbDataAdapter in C#

倖福魔咒の 提交于 2020-01-05 03:36:10
问题 I'm using OleDb to populate a DataTable. I'm trying to use a parameterized query, but it doesn't seem to work with a OleDbDataAdapter. Anyone have any suggestions? cmd.CommandText = "SELECT A,B,C,D FROM someTable WHERE A=@A AND D BETWEEN @D1 AND @D2"; cmd.Parameters.Add("@A", OleDbType.VarChar).Value = "1234567"; cmd.Parameters.Add("@D1", OleDbType.DBDate).Value = "02/01/2011"; cmd.Parameters.Add("@D2", OleDbType.DBDate).Value = "01/31/2012"; A first chance exception of type 'System.Data

Cannot initialize the data source object of OLE DB provider “Microsoft.Jet.OLEDB.4.0” for linked server “(null)”

房东的猫 提交于 2020-01-05 01:31:09
问题 I got an error like this 'Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)". OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Could not find installable ISAM.".' while transferring database from msaccess to SQL I have written this code try { DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb"); DataTable userTables = null; using (connection) { string mappath =

Reading xlsx file in c# using OleDbConnection throws error

蓝咒 提交于 2020-01-04 05:14:28
问题 I wrote a console application to read the xlsx file in C# using OleDbConnection . It throws the following error The Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. Below is the code i have written string connString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\Suganya\ColumnReport.xlsx;Extended Properties=Excel 12.0;"; OleDbConnection objConn = new OleDbConnection(); OleDbDataAdapter dataAdapter = new OleDbDataAdapter(); objConn = new OleDbConnection

SSIS not running in parallel with OraOLEDB.Oracle.1 Provider

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-04 04:44:09
问题 we had one SSIS package with Oracle 11 Client, we would run our daily query with 30min to 1 hour run time. we had to upgrade our oracle clients as one of our other oracle source got upgraded. post upgrade to Oracle 12c, our daily job run time increased. oracle DBA said, its not running in parallel, as its occupying only one processor. when we run the same query from SQL Developer or toad, its running in parallel. but if we run from SSIS OLEDB Source component its not running in parallel. I'm

ACE.OLEDB provider incorrectly reads some column names

喜你入骨 提交于 2020-01-04 04:12:05
问题 I'm reading an excel file from a C# app using ACE.OLEDB. Everything has worked fine so far until today I noticed that one of the column names is read incorrectly. Here's what I've got in my excel file Here's what I've got in my debugger Basically the dot (".") is replaced with a hash ("#") for some reason. The code is straightforward and works fine for the most part, don't think the problem is there, but will show it here just for the sake of clarity. DataTable data = new DataTable(); string

Microsoft Jet oledb connection to excel loses formulae

三世轮回 提交于 2020-01-04 02:48:08
问题 I have a dataset and I write it's values to an excel file using Microsoft Jet 4.0 Oledb provider. I want to put hyperlinks into the excel, for this I write "=HYPERLINK("http://www.abc.org/x.pdf")" in DS and then write it to excel. But when the excel is opened it prefixes a ' (quote/apostrophe) before the formula and there it comes as a text, not link. Can you help me removing that quote so that my excel file has hyperlinks instead of that as text? I need to use Microsoft Jet 4.0 provider (not

Inserting a row into Excel Spreadsheet via C# and OleDb

一个人想着一个人 提交于 2020-01-04 02:27:08
问题 I need to programmatically insert a row into an Excel Spreadsheet multiple times. I need to actually insert a new row and not insert data, that is, I need to actually shift all other rows down by one. I am currently using OleDB to insert the data itself like so: //Note I have missed some code out for simplicities sake, this all works fine however OleDbConnection oledbConn = null; OleDbCommand cmd = null; OleDbConnection = new OleDbConnection(connString); OleDbConnection.Open(); string

Use OLEDB to read AccessFile from Stream to DataSet

☆樱花仙子☆ 提交于 2020-01-03 15:16:30
问题 I Use Oledb to read an AccessFile(.accdb) to DataSet, I don't know about table names or columns, The regular implementation is: public void GetAccessDB(string filepath){ this.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source = " + filepath; // get Table Names this.TableNames = new List<string>(); using (System.Data.OleDb.OleDbConnection oledbConnection = new System.Data.OleDb.OleDbConnection(this.ConnectionString)) { oledbConnection.Open(); System.Data.DataTable dt = null; dt

Good OleDB/ODBC provider for PostgreSQL

ぐ巨炮叔叔 提交于 2020-01-03 10:42:26
问题 I'm in need of a functional OleDB data provider for PostgreSQL. It should be similar to the ODBC provider for MySQL. See http://dev.mysql.com/downloads/connector/odbc/5.1.html 回答1: The postgres software catalog has some providers on there. 回答2: dotConnect for PostgreSQL (from Devart) offers a pretty good one. It is fast and works. The free version will give you your basic ADO.net support, the pay offers everything else. ODBC doesn't have a free version. http://www.devart.com/dotconnect