oledb

C# NUnit 3 Data Driven from Excel

梦想与她 提交于 2019-12-19 10:55:10
问题 Hello I have the following file: testexcel.xlsx > sheet 1 I want to execute this test twice as there are 2 rows with data. [Test] [TestCaseSource("Data")] public void Login(String username, String password) { loginPageModel.DoLogin(username, password); } How can I convert that excel data into this kind of data as explained in NUnit 3 official documentation? static object[] Data = { new object[] {username, password} }; 回答1: What i did is the following and it's working I have the Test: [Test

Error on only Azure - 'Microsoft.ACE.OleDb.12.0' provider is not registered on the local machine

元气小坏坏 提交于 2019-12-19 09:47:55
问题 I am working with MS Excel files in my web application built in Azure environment. I never run into following error when I am trying to access the excel file on my development fabric. But once I deploy to Azure in cloud, I get this error message. The 'Microsoft.ACE.OleDb.12.0' provider is not registered on the local machine. I was under impression that development fabric for Azure is replica of the environment you would expect in Cloud. Is there something wrong I am doing here? Is ACE.OleDb

How can I dodge empty rows in an Excel file with OleDB?

梦想的初衷 提交于 2019-12-19 09:19:30
问题 I start to use OleDB. I'm trying to extract a large range of random data from an Excel file (in C#). This my query : SELECT * FROM NAMED_RANGE But I have a lot of empty rows. I delete them in a loop but I don't really like it, is it possible to select only rows with at least one cell filled ? Best regards, Alex 回答1: Simply change the SQL Query: SELECT * FROM NAMED_RANGE WHERE [YourColumnTitle] IS NOT NULL Or if [F1] is your Column: SELECT * FROM NAMED_RANGE WHERE F1 IS NOT NULL Thanks to mr

OleDb connection to Excel; how do I select fixed width, unbounded height?

廉价感情. 提交于 2019-12-19 08:07:09
问题 I'm using OleDb to select data from excel spreadsheets. Each spreadsheet can contain many small tables, and possibly furniture like titles and labels. So it might look like this, where we have two tables and some titles; A B C D 1 . . . . 2 . . . . 3 Table1 . . . 4 Header1 HEADER2 . . 5 h huey . . 6 d dewey . . 7 l loius . . 8 s scrooge . . 9 . . . . 10 . . . . 11 . . . . 12 . . . . 13 . Table 2 . . 14 . HEADER1 HEADER2 HEADER3 15 . 1 foo x 16 . 2 bar y 17 . 3 baz z 18 . . . . 19 . . . . In a

OPENROWSET with Excel file

有些话、适合烂在心里 提交于 2019-12-19 04:50:46
问题 I want to execute simple statement: SELECT * FROM OPENROWSET('MICROSOFT.JET.OLEDB.4.0','Text;Database=C:\Temp\;','SELECT * FROM [test.csv]') And suddenly I get this message today morning: Msg 7308, Level 16, State 1, Line 1 OLE DB provider 'MICROSOFT.JET.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode. It was working till today morning! Here is my server specs: Windows 2008 R2 64 bit SQL Server 2008 64 bit I've

Querying an Oracle database from SQL Server

安稳与你 提交于 2019-12-19 03:21:35
问题 I have an Oracle 11g XE database that I would like to transfer into SQL Server Express 2005. At first I thought I'd just generate the tables in Oracle as SQL, manipulate the data formats, and run the query in SQL Server. This worked for small tables, but I have several tables with a few hundred thousands rows and some with millions of rows, so this solution won't work. I then created a TNS file with the following content: OracleTnsName = ( DESCRIPTION= ( ADDRESS = (PROTOCOL=TCP)(HOST

Querying an Oracle database from SQL Server

我怕爱的太早我们不能终老 提交于 2019-12-19 03:20:35
问题 I have an Oracle 11g XE database that I would like to transfer into SQL Server Express 2005. At first I thought I'd just generate the tables in Oracle as SQL, manipulate the data formats, and run the query in SQL Server. This worked for small tables, but I have several tables with a few hundred thousands rows and some with millions of rows, so this solution won't work. I then created a TNS file with the following content: OracleTnsName = ( DESCRIPTION= ( ADDRESS = (PROTOCOL=TCP)(HOST

DTS_E_OLEDBERROR. Error code: 0x80004005.Difference between SQl Native client and oledb provider for sql server

别等时光非礼了梦想. 提交于 2019-12-19 02:18:06
问题 There was a communication link error while I was using SQL Server Native Client 10 in an SSIS Data Flow component. Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Communication link failure".An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "TCP Provider: The specified

fetch column names for specific table

倾然丶 夕夏残阳落幕 提交于 2019-12-18 17:04:12
问题 I want to fetch all the column names for specific table.. I am using msaccess and C# .net 2008. 回答1: You can fetch schema information for a given query through OleDb using the SchemaOnly CommandBehavior and the GetSchemaTable method, as follows: var conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NWIND.mdb"; using (var con = new OleDbConnection(conStr)) { con.Open(); using (var cmd = new OleDbCommand("select * from Suppliers", con)) using (var reader = cmd.ExecuteReader(CommandBehavior

Can we add Reference of 'Microsoft.ACE.Oledb.12.0.dll' to project

旧城冷巷雨未停 提交于 2019-12-18 13:27:42
问题 I am getting error "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine." on my testing servers. So My Question is : i) Can i add reference for "'Microsoft.ACE.Oledb.12.0.dll'" to project it self? ii) Is it safe? iii) How to do this? Every thing is working on my local machine since i have latest version of office install in my machine. As soon as i am deploying my code to testing servers i am getting above error. I might not be able to install Office on testing