oledb

Syntax error (missing operator) in query expression, Oledb UPDATE Statement

折月煮酒 提交于 2019-12-11 08:26:52
问题 I'm a beginner at c# and I've tried looking through many posts to try and resolve my problem but I haven't had any luck, so I thought I may as well create a post to ask for your help. Basically,I'm trying to update an excel file with some extra info, but the problem is every-time I run the source code I keep getting this error: An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll Additional information: Syntax error (missing operator) in query

Good .NET ORM Framework that supports OleDb and Stored Procedures?

筅森魡賤 提交于 2019-12-11 07:46:00
问题 A typical stored procedure in our system accepts around 20 or so parameters. There's no chance of refactoring these stored procedures either. I've basically resorted to writing my own code generator that wraps these SP's into (database provider agnostic) "Command" objects, with their public properties corresponding to the SP parameters. It works, but I'd prefer a 3rd party tried and tested solution. Can anyone recommend anything? I haven't found one that supports OleDB and stored procedures.

OleDb Object Invalid or No Longer Set

怎甘沉沦 提交于 2019-12-11 07:34:30
问题 I'm trying to read an excel file using an OleDb Reader, I couldn't debug the code because this error only comes out on a production server. It really doesn't make sense to me, could anyone help me? From the logs the error comes out as: System.Data.OleDb.OleDbException: Object invalid or no longer set. at System.Data.OleDb.OleDbConnectionInternal.ProcessResults(OleDbHResult hr) at System.Data.OleDb.OleDbConnectionInternal.GetSchemaRowset(Guid schema, Object[] restrictions) at System.Data.OleDb

Importing CSV files using OleDB - string datatype?

99封情书 提交于 2019-12-11 07:27:46
问题 I'm writing a C# .net web application, and users will be uploading CSV files to be processed. These CSV files contain a number of data types, and I'm having trouble with a few of them. There is a 20-digit receipt number field that is getting imported in scientific notation (9.1234563E+18 instead of 91234563000000000000), and any leading zeros are getting dropped. Leading zeros are also dropped in another 4-digit store number field. I've read about creating a Schema.ini file to define the

Fastest OLEDB read from ORACLE

戏子无情 提交于 2019-12-11 07:24:56
问题 What would be the fastest way of retrieving data from the Oracle DB via OLEDB? It should be portable (have to work on Postgres and MS SQL), only one column is transfered (ID from some large table). Current performance is 100k rows/sec. Am I expecting too much if I want it to go faster? Clarification: datatable has 23M records Query is: SELECT ID FROM OBJECTS Bottleneck is transfer from oracle to the client software, which is c++/OLEDB 回答1: What the heck, I'll take a chance. Edit: As far as

Storing diverse value types in a database

江枫思渺然 提交于 2019-12-11 07:10:08
问题 I need to store key-value pairs in a database, where key is either e.g. a string, and value can be one of multiple types (integer, string, float/date, GUID, BLOB). The Database is accessed through OLE DB, so I want need to stick to "normal" types. They keys might be involved in "exists" queries, values are not involved in queries (i.e. I won't query for "all keys where value is 17"). Additional key-value-pairs will be added later. I currently see the following options: 1. Serialized BLOB

How to print a parametrized SQL query?

非 Y 不嫁゛ 提交于 2019-12-11 06:55:55
问题 How can I get a String with a parametrized SQL query, once parameters inserted ? 回答1: I think you're assuming that the parameter values will be injected into the SQL and that what ends up being sent to the server is a single string. There's no reason why that needs to be the case - although it could be in some cases. Generally it would make more sense to send the parameters to the database alongside the SQL but distinct from it. That way there's less work for the SQL engine to do (e.g.

Read Data from Excel using OLEDB

我的梦境 提交于 2019-12-11 06:45:43
问题 I read an excel file using OLEDB. Below is the code: string conn; conn = ("Provider=Microsoft.ACE.OLEDB.12.0;" + ("Data Source=" + _filename + ";" + "Extended Properties=\"Excel 12.0;\"")); OleDbConnection oleDBCon = new OleDbConnection(conn); oleDBCon.Open(); DataTable dt = oleDBCon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); string SSQL = "SELECT * from [ Sheet1$ ]"; OleDbDataAdapter oleDA = new OleDbDataAdapter(SSQL, conn); DataSet ds = new DataSet(); oleDA.Fill(ds); DataTable

Getting “External table is not in the expected format.” error while trying to import an Excel File in SSIS

谁说胖子不能爱 提交于 2019-12-11 06:15:54
问题 I am trying to import an Excel file ( .xls ) via SSIS to a table in SQL Server. But SSIS doesn't seem to recognize the file as a valid Excel file. I get the following errors: Error 1: [Excel Source [86]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Carga Base Original" failed with error code 0xC0202009. There may be error messages posted before this with more information on why the AcquireConnection

Why OleDbConnection.Open() throws Unrecognized database format if Ole.DB provider is available on the system

空扰寡人 提交于 2019-12-11 06:06:44
问题 I tried next code on Windows x64, but the code is compiled and run as x86. The same behaviour is if I run the application in Windows 7 or 10 x86. static IList<string> GetOleDbProviders() { OleDbEnumerator oleDbEnumerator = new OleDbEnumerator(); DataTable oleDbProviders = oleDbEnumerator.GetElements(); IDictionary<string, string> descriptions = new Dictionary<string, string>(); int typeColumnIndex = oleDbProviders.Columns.IndexOf("SOURCES_TYPE"); int nameColumnIndex = oleDbProviders.Columns