oledb

SQL Server 2012 via native C++ (no ATL) preferred access method from Windows

末鹿安然 提交于 2019-12-07 11:13:32
问题 I have a native C++ application that runs under Windows 64, it doesn't use ATL (and will not). I want to be able to connect from my application to SQL Server 2012 over the network. I have the following requirements: Performance is the key The C++ will only insert records (say by calling Stored Procs), nothing else (no selects, deletes or updates). Record insertions should be non-blocking (async). I narrowed my choices down to OLE DB and ODBC as they satisfy the criteria above. However, it

Why is first empty line ignored in Excel import with OleDb

南楼画角 提交于 2019-12-07 10:29:24
问题 With .Net's OleDb I try to import an Excel table in which the first row(s) can be empty. I want to keep the empty row in the DataTable to be able to map the cells to Excel-style cell names "A1, A2, ..." later. But the first line is removed, no matter what I do. Excel file looks like: - - - ABC XY ZZ 1 2 3 4 4 5 Where "-" is an empty cell. (I have no influence to the import format.) Simplified code: string cnnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"file.xls\";Extended Properties=

SQL Server Linked Server to Microsoft Access

家住魔仙堡 提交于 2019-12-07 08:02:15
问题 I have tried to make use of linked servers in SQL Server 2008 by doing the following to access a Microsoft Access 2003 Table. EXEC sp_addlinkedserver access1t, 'OLE DB Provider for Jet', 'Microsoft.Jet.OLEDB.4.0', 'C:\tester.mdb' EXEC sp_addlinkedsrvlogin access1t, FALSE, Null, Admin, Null GO CREATE VIEW TI001APCE1265 AS SELECT * FROM access1t...Table1 However, I get the error: OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "access1t" returned message "Unspecified error". Msg

Using OleDbConnection to Read Tab-Separated File

瘦欲@ 提交于 2019-12-07 06:55:01
问题 My tab-delimited file is something like this: ISO ISO3 ISO-Numeric AD AND 20 I've been trying the following code with no luck. OleDbConnection cn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source= |DataDirectory|;Extended Properties='text;HDR=Yes;FMT=TabDelimited'"); OleDbCommand cmd = new OleDbCommand(@"SELECT * FROM countryInfo.txt", cn); OleDbDataAdapter da = new OleDbDataAdapter(cmd); cn.Open(); DataTable dt = new DataTable(); da.Fill(dt); Here's a screenshot of the

C# Microsoft Access Parameterized Queries not doing its job

元气小坏坏 提交于 2019-12-07 05:13:42
问题 I have already done research into this, and though the below questions are similar, I have tried them all, but none seems to solve my issue. Proper way of getting a data from an Access Database using parameters inserting data into access database Getting Data from Access into a text box in C# by clicking a button UPDATE query on Access Database not working C#.NET passing parameter to access query from c# Parameterized query for inserting values Here is the part of the code that is relevant:

How to install DB2 ODBC or OLEDB Driver

北慕城南 提交于 2019-12-07 04:44:02
问题 I have already installed IBM DB2 Database Express on Windows 7 Pro. Now, I would like to create my C# code in order to select/insert/update records in DB2 tables. I spend the whole day searching over the internet for links on how to install either OLEDB or ODBC Driver in order to connect to DB2 database. But without success!!! So, i'm wondering if somebody can help me or send me a useful link to download driver. Thank you 回答1: Download: In the webpage: http://www-933.ibm.com/support

How to read a CLOB column in Oracle using OleDb?

北慕城南 提交于 2019-12-07 03:37:22
问题 I have created a table on an Oracle 10g database with this structure : create table myTable ( id number(32,0) primary key, myData clob ) I can insert rows in the table without any problem, but when I try to read data from the table using OleDb connection, I get an exception. Here is the code I use : using (OleDbConnection dbConnection = new OleDbConnection("ConnectionString")) { dbConnection.Open(); OleDbCommand dbCommand = dbConnection.CreateCommand(); dbCommand.CommandText = "SELECT * FROM

Excel Cell Formatting Problem

╄→гoц情女王★ 提交于 2019-12-07 03:18:29
问题 I'm using the OleDB DataReader to get data from my excel files (but this problem occurs in DataTable.Fill as well). The thing is that I have a column that should return strings. All's fine and working but recently, an issue came up, because the column's cells had different formats. Some were in numbers and others in text. When I checked using dataReader.GetSchema() it showed that the column in question was inferred as type System.String. The problem with this was that all non-text cells were

How do I update excel file with oleDbDataAdapter.Update(myDataSet)

白昼怎懂夜的黑 提交于 2019-12-07 02:35:27
I keep getting an InvalidOperationException ("Update requires a valid UpdateCommand when passed DataRow collection with modified rows"). I just cant work out what's wrong with the update command. Here's the code I have so far: OleDbConnection connection; OleDbDataAdapter clientsAdapter new OleDbDataAdapter(); DataSet myDataSet = new DataSet(); public void Setup() { connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Clients.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES"";"; connection = new OleDbConnection(connectionString); connection.Open(); // SQL clientsAdapter

Ms Access: Record(s) cannot be read; no read permission on [table]

纵饮孤独 提交于 2019-12-07 00:14:59
问题 i wrote script for downloading mdb files and reading them due OLEDB provider. All works fine, but if i try to read from table, it throws an exception: Ms Access: Record(s) cannot be read; no read permission on tblMytable var cmd = new OleDbCommand("SELECT * FROM tblMytable", conn); var reader = cmd.ExecuteReader(); I changed permissions directly in Ms Access for user "administrator" and it works. But the problem is, that this script musst run twice a day and it downloads about 20 files. So