oledb

Performance of OLEDB to read Excel

南楼画角 提交于 2019-12-30 09:48:28
问题 Following code takes like 2500 milliseconds on an i7-*3.4 GHz windows-7 64-bit computer to read an excel sheet with 25000 lines and 5 columns. Each cell approximately include a string with 10 characters. Is it normal? How can I read it faster? Stopwatch sw1 = Stopwatch.StartNew(); var connectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; " + "Extended Properties=Excel 12.0;", filename); var adapter = new OleDbDataAdapter("SELECT * FROM [roots$]",

PHP with Oledb

房东的猫 提交于 2019-12-30 06:39:28
问题 Can I use PHP with Oledb connection? As far as I know database connection as provided by PHP extension are all odbc. 回答1: You can use ActiveX Data Objects (Microsoft's OLEDB ActiveX layer) in PHP-Win without any third party extension as such: $conn = new COM("ADODB.Connection") or die("Cannot start ADO"); // Microsoft Access connection string. $conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\inetpub\wwwroot\php\mydb.mdb"); // SQL statement to build recordset. $rs = $conn->Execute

Microsoft.Jet.OLEDB.4.0 Converting Characters

元气小坏坏 提交于 2019-12-28 18:14:30
问题 I'm working with a CSV that contains characters like: ” and • I am reading the CSV via OleDb and the provider is Microsoft.Jet.OLEDB.4.0. when the data is loaded into the OleDbCommand, the characters are converted to the following respectively: “ and • I suspected there might be a collation setting in the connection string but I was unable to find anything about this. I can confirm the following: I can see the original character in the CSV when I open it. If I run a select on the file

Is there a “proper” way to read CSV files [duplicate]

为君一笑 提交于 2019-12-28 03:38:34
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: CSV File Imports in .Net In .net, is there a standard library that should be used to read in csv files? All the samples on the web roll their own csv reader / parser, or use OleDb. It's not a problem using any of these solutions, I was just wondering if there is a generally accepted library (not that I can find), or any other "proper" way to do it? 回答1: CsvReader is a pretty good one... it isn't Microsoft, but

Reading excel file using OLEDB Data Provider

别等时光非礼了梦想. 提交于 2019-12-27 12:23:32
问题 I am using OLEDB Data Provider to read excel file, but the problem is that in excel sheet some cloumn has an invalid value for example instead of number string is there, When I read this invalid value I get an empty string instead of actual value. for above screenshot when i read value john getting empty string. So is there any way to read this invalid value? Any help will be appreciated. The Code is to read excel file private DataTable ReadExcelFile(string sheetName, string path) { using

Reading excel file using OLEDB Data Provider

心已入冬 提交于 2019-12-27 12:22:15
问题 I am using OLEDB Data Provider to read excel file, but the problem is that in excel sheet some cloumn has an invalid value for example instead of number string is there, When I read this invalid value I get an empty string instead of actual value. for above screenshot when i read value john getting empty string. So is there any way to read this invalid value? Any help will be appreciated. The Code is to read excel file private DataTable ReadExcelFile(string sheetName, string path) { using

specified cast is not valid

[亡魂溺海] 提交于 2019-12-25 16:51:44
问题 Here is a code that retrieve values from the database, but my problem is that it throws out an exception saying "InvalidCastException was unhandled specified cast is not valid". I am now confused what went wrong, The code and the table stated below. Here is the code: Public connstring As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source =" & Application.StartupPath & "\TestData.accdb; Persist Security info = false" Public Conn As New OleDbConnection Private Sub TestForm_Load(ByVal

application program parameters for the current request are not valid. reason code 03. SQLSTATE: 07002, SQLCODE: -804

梦想的初衷 提交于 2019-12-25 12:38:25
问题 I'm working on a desktop application and using OLEDB providers to connect to DB2 database. The below query is successful for few accounts and not working for few accounts Working account numbers - 1004423,1008647,1008655,1009283,1031556 Failed account numbers - 1023088,1025238,1026210,1029648,1031169 Customer number is same for all the accounts. Any ideas why these account numbers are getting failed? OleDbConnection conn = new OleDbConnection("ConnectionString"); conn.Open(); DbTransaction

application program parameters for the current request are not valid. reason code 03. SQLSTATE: 07002, SQLCODE: -804

落爺英雄遲暮 提交于 2019-12-25 12:38:10
问题 I'm working on a desktop application and using OLEDB providers to connect to DB2 database. The below query is successful for few accounts and not working for few accounts Working account numbers - 1004423,1008647,1008655,1009283,1031556 Failed account numbers - 1023088,1025238,1026210,1029648,1031169 Customer number is same for all the accounts. Any ideas why these account numbers are getting failed? OleDbConnection conn = new OleDbConnection("ConnectionString"); conn.Open(); DbTransaction

C# Oledb 0x80040E14 INSERT INTO error

旧城冷巷雨未停 提交于 2019-12-25 10:54:46
问题 I'm working on a project where you can add users to a database with the INSERT INTO command and an Acces database (OleDB). I'm having an 0x80040E14 error which I can't seem to get solved. Code below: public void AddUser() { OleDbConnection DATABASE_CONNECTION = new OleDbConnection(CONNECTION_STRING); try { DATABASE_CONNECTION.Open(); String SQL_QUERY = "INSERT INTO Users(Username, Password, Voornaam, Tussenvoegsel, Achternaam, Email, VolledigeNaam) VALUES(?, ?, ?, ?, ?, ?, ?)"; OleDbCommand