oledb

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.

Check for either ADO.NET / OLEDB Connection presence

我只是一个虾纸丫 提交于 2019-12-13 17:19:07
问题 I am developing a custom SSIS component for use across my entire company. Right now the code (which is from here) accepts only ADO.NET connection type. I would like to support OLEDB type as well and would like to change my code accordingly. The piece of code that checks for valid ADO.NET connectivity is: SqlConnection connection = connections[_connectionName].AcquireConnection(null) as SqlConnection; if (connection == null) { componentEvents.FireError(0, METHOD_NAME, "The connection is not a

Persuade Access 2007 to use a .UDL file/oledb connection?

冷暖自知 提交于 2019-12-13 16:25:23
问题 Is there any way of coaxing Access 2007 into using a .UDL file? Specifically, one of our older products uses an Interbase 6.0 database. My client would like to link to his database, for read/write, using Access 2007 (in the short term). While this isn't my preferred way of doing things at all, given it's all single-user and the other access to the Interbase database is all done via a Delphi 7 client, I can't really just say 'no' - at least, not until I have the time to 'properly' give him

Write Data to Excel using Oledb

[亡魂溺海] 提交于 2019-12-13 15:08:31
问题 Is it possible to write data using Oledb into a common excel ? There are no table structure or anything, it's a user document. When I tried, i had always an OleDbException "INSERT" query reply : Operation must use an application that can be updated. "UPDATE" query reply : No value given for one or more required parameters. My code: using (OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + @"C:\Users\[...]\Classeur.xls" + ";Extended Properties=

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

Reading A Fixed Format Text File - Part 2

此生再无相见时 提交于 2019-12-13 11:29:46
问题 This is a followup question to the question: I am attempting to read a Fixed Format Text file using the Microsoft.ACE.OLEDB.12.0 Provider. I have a half dozen different ways to setup the driver and/or provider and pretty much run into the same problem every time. I am for some reason unable to even "get started" because of "Could not find installable ISAM" exceptions or errors and exceptions with the driver. The system has Office 2007 installed so the "Could not find installable ISAM" does

Select MAX INT value of TEXT column

三世轮回 提交于 2019-12-13 09:18:50
问题 UserID UserName Password 1 abc 123 10 xyz 456 3 mno 254 SELECT MAX(UserId) AS UserId FROM UserLogin When I run this query it gives me 3 instead of 10 All columns are TEXT datatype 回答1: Your query is returning 3 because it is the larger value considering lexicographic order (anything starting with 3 is considered greater than anything starting with 1 , just like something starting with b is greater than anything starting with a ). Use the VAL function to convert the TEXT columns into numeric

OledbCommandBuilder Syntax error in insert into Statement c#?

妖精的绣舞 提交于 2019-12-13 07:49:04
问题 I know this question has been asked a hundred of times and I have looked at them all and don't know what's going wrong. This is the table in access: tbl_Slip SlipNo*, EmpID, ScaleID, Month-Year, RaiseBasic, OtherDed, Tax, Arrears, Notes, all the fields are integer type except for Month-Year and Notes which are text. Now the C# Part: This is the code I use. I tried to find out the error so made a button with harcoded values. (The oledbConnection works fine. I use it to display data on the form

Filling DataGridView row by row only populates last row

ε祈祈猫儿з 提交于 2019-12-13 07:25:43
问题 I'm trying to fill a datagridview with one column of integers using a loop. I'm pretty sure I've got the loop and excel reference correct, as I've used this on other projects, but it won't display correctly. Here's the code: Dim da As OleDbDataAdapter Dim ds As DataSet xlWorkbook2 = xlApp.Workbooks.Open(FormFile) xlWsheet2 = xlWorkbook2.Sheets(sheetname) 'open connection to nit spreadsheet' Dim cn As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=""" & FormFile & """

Connect to MS Access DB (.accdb) Without “Access Database Engine 2010”

寵の児 提交于 2019-12-13 07:00:13
问题 I'm working on a 64 bit C# solution and I wish to connect to an MS Access DB (.accdb file) without installing "Access Database Engine x64". The "Access Database Engine x64" installation demand that the currently installed MS Office version is a 64 bit, which is not an acceptable demand in the company environment. I realized that OLEDB and ODBC demand that "Access Database Engine x64" will be installed. Is there another way to connect to the Access file? Thanks! 回答1: I realized that OLEDB and