How to use OleDbExecutionEngine method of NBi.Core.Query.Execution.OleDbExecutionEngine class

Best NBi code snippet using NBi.Core.Query.Execution.OleDbExecutionEngine.OleDbExecutionEngine

OleDbExecutionEngineTest.cs

Source:OleDbExecutionEngineTest.cs Github

copy

Full Screen

...6using NBi.Core;7namespace NBi.Testing.Integration.Core.Query.Execution8{9 [TestFixture]10 public class OleDbExecutionEngineTest11 {12 [Test]13 public void Execute_WaitFor3SecondsTimeoutSetTo1_Timeout()14 {15 var query = "WAITFOR DELAY '00:00:03';";16 var cmd = new OleDbCommand(query, new OleDbConnection(ConnectionStringReader.GetOleDbSql()))17 {18 CommandTimeout = 119 };20 var qe = new OleDbExecutionEngine(cmd.Connection, cmd);21 Assert.Throws<CommandTimeoutException>(delegate { qe.Execute(); });22 }23 [Test]24 public void Execute_WaitFor3SecondsTimeoutSetTo0_NoTimeOut()25 {26 var query = "WAITFOR DELAY '00:00:03';";27 var cmd = new OleDbCommand(query, new OleDbConnection(ConnectionStringReader.GetOleDbSql()))28 {29 CommandTimeout = 030 };31 var qe = new OleDbExecutionEngine(cmd.Connection, cmd);32 Assert.DoesNotThrow(delegate { qe.Execute(); });33 }34 [Test]35 public void Execute_ValidQuery_DataSetFilled()36 {37 var query = "select * from [Sales].[Currency];";38 var cmd = new OleDbCommand(query, new OleDbConnection(ConnectionStringReader.GetOleDbSql())) { CommandTimeout = 0 };39 var qe = new OleDbExecutionEngine(cmd.Connection, cmd);40 var ds = qe.Execute();41 Assert.That(ds.Tables, Has.Count.EqualTo(1));42 Assert.That(ds.Tables[0].Columns, Has.Count.EqualTo(3));43 Assert.That(ds.Tables[0].Rows, Has.Count.EqualTo(105));44 }45 [Test]46 public void ExecuteScalar_ValidQuery_DataSetFilled()47 {48 var query = "select top(1) CurrencyCode from [Sales].[Currency] where Name like '%Canad%'";49 var cmd = new OleDbCommand(query, new OleDbConnection(ConnectionStringReader.GetOleDbSql())) { CommandTimeout = 0 };50 var qe = new OleDbExecutionEngine(cmd.Connection, cmd);51 var value = qe.ExecuteScalar();52 Assert.That(value, Is.EqualTo("CAD"));53 }54 [Test]55 public void ExecuteList_ValidQuery_DataSetFilled()56 {57 var query = "select top(10) CurrencyCode from [Sales].[Currency] where CurrencyCode like '%D' order by 1 asc";58 var cmd = new OleDbCommand(query, new OleDbConnection(ConnectionStringReader.GetOleDbSql())) { CommandTimeout = 0 };59 var qe = new OleDbExecutionEngine(cmd.Connection, cmd);60 var values = qe.ExecuteList<string>();61 Assert.That(values, Has.Count.EqualTo(10));62 Assert.That(values, Has.Member("CAD"));63 }64 }65}...

Full Screen

Full Screen

OledbExecutionEngine.cs

Source:OledbExecutionEngine.cs Github

copy

Full Screen

...10 /// Engine wrapping the System.Data.OleDb namespace for execution of NBi tests11 /// <remarks>Instances of this class are built by the means of the <see>QueryEngineFactory</see></remarks>12 /// </summary>13 [SupportedCommandType(typeof(OleDbCommand))]14 internal class OleDbExecutionEngine : DbCommandExecutionEngine15 {16 public OleDbExecutionEngine(OleDbConnection connection, OleDbCommand command)17 : base(connection, command)18 { }19 20 internal override void OpenConnection(IDbConnection connection)21 {22 var connectionString = Command.Connection.ConnectionString;23 try24 { connection.ConnectionString = connectionString; }25 catch (ArgumentException ex)26 { throw new ConnectionException(ex, connectionString); }27 try28 { connection.Open(); }29 catch (OleDbException ex)30 { throw new ConnectionException(ex, connectionString); }...

Full Screen

Full Screen

OleDbPerformanceEngine.cs

Source:OleDbPerformanceEngine.cs Github

copy

Full Screen

...11 internal class OleDbPerformanceEngine : DbCommandPerformanceEngine12 {13 14 protected internal OleDbPerformanceEngine(OleDbConnection connection, OleDbCommand command)15 : base(new OleDbExecutionEngine(connection, command))16 { }17 }18}...

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Query.Execution;7using NBi.Core.Query;8using NBi.Core.Query.Resolver;9using System.Data;10using System.Data.OleDb;11using System.IO;12{13 {14 static void Main(string[] args)15 {16 var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Public\\Documents\\Northwind.accdb;Persist Security Info=False;";17 var commandText = "SELECT * FROM [Customers]";18 var command = new NBi.Core.Query.Command(commandText, CommandType.Text);19 var engine = new OleDbExecutionEngine();20 var resolver = new CommandResolver(command);21 var result = engine.Execute(resolver.Instantiate());22 foreach (DataRow row in result.Rows)23 {24 Console.WriteLine(row["ContactName"]);25 }26 Console.ReadLine();27 }28 }29}30using System;31using System.Collections.Generic;32using System.Linq;33using System.Text;34using System.Threading.Tasks;35using NBi.Core.Query.Execution;36using NBi.Core.Query;37using NBi.Core.Query.Resolver;38using System.Data;39using System.Data.OleDb;40using System.IO;41{42 {43 static void Main(string[] args)44 {45 var connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Public\\Documents\\Northwind.accdb;Persist Security Info=False;";46 var commandText = "SELECT * FROM [Customers]";47 var command = new NBi.Core.Query.Command(commandText, CommandType.Text);48 var engine = new OleDbExecutionEngine();49 var resolver = new CommandResolver(command);50 var result = engine.Execute(resolver.Instantiate());51 foreach (DataRow row in result.Rows)52 {53 Console.WriteLine(row["ContactName"]);54 }55 Console.ReadLine();56 }57 }58}59using System;60using System.Collections.Generic;61using System.Linq;62using System.Text;63using System.Threading.Tasks;64using NBi.Core.Query.Execution;65using NBi.Core.Query;

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Query.Execution;7{8 {9 static void Main(string[] args)10 {11 OleDbExecutionEngine engine = new OleDbExecutionEngine();12 engine.Command = "SELECT {[Measures].[Unit Sales]} ON COLUMNS, {[Time].[1997].[Q1]} ON ROWS FROM [Sales]";13 engine.Execute();14 Console.WriteLine(engine.Result);15 Console.ReadLine();16 }17 }18}19using System;20using System.Collections.Generic;21using System.Linq;22using System.Text;23using System.Threading.Tasks;24using NBi.Core.Query.Execution;25{26 {27 static void Main(string[] args)28 {29 XmlaExecutionEngine engine = new XmlaExecutionEngine();30 engine.Command = "SELECT {[Measures].[Unit Sales]} ON COLUMNS, {[Time].[1997].[Q1]} ON ROWS FROM [Sales]";31 engine.Execute();32 Console.WriteLine(engine.Result);33 Console.ReadLine();34 }35 }36}37using System;38using System.Collections.Generic;39using System.Linq;40using System.Text;41using System.Threading.Tasks;42using NBi.Core.Query.Execution;43{44 {45 static void Main(string[] args)46 {47 OdbcExecutionEngine engine = new OdbcExecutionEngine();48 engine.ConnectionString = "Driver={SQL Server};Server=ServerName;Database=DatabaseName;Trusted_Connection=yes;";49 engine.Command = "SELECT * FROM [dbo].[Table1]";50 engine.Execute();51 Console.WriteLine(engine.Result);52 Console.ReadLine();53 }54 }55}

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1using System;2using System.Data.OleDb;3using NBi.Core.Query.Execution;4{5 {6 static void Main(string[] args)7 {8 OleDbExecutionEngine engine = new OleDbExecutionEngine();9 OleDbCommand command = new OleDbCommand("SELECT * FROM [Sheet1$]");10 command.Connection = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\Public\\Documents\\NBi\\NBiTest.xlsx;Extended Properties=Excel 12.0;");11 var result = engine.Execute(command);12 foreach (var item in result.Rows)13 {14 Console.WriteLine(item);15 }16 Console.ReadLine();17 }18 }19}

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Query.Execution;7using System.Data.OleDb;8{9 {10 private readonly OleDbConnection connection;11 private readonly string commandText;12 private readonly OleDbCommand command;13 public OleDbExecutionEngine(string connectionString, string commandText)14 {15 connection = new OleDbConnection(connectionString);16 this.commandText = commandText;17 command = new OleDbCommand(commandText, connection);18 }19 public void Open()20 {21 connection.Open();22 }23 public void Close()24 {25 connection.Close();26 }27 public void ExecuteNonQuery()28 {29 command.ExecuteNonQuery();30 }31 public object ExecuteScalar()32 {33 return command.ExecuteScalar();34 }35 public IDataReader ExecuteReader()36 {37 return new OleDbDataReader(command.ExecuteReader());38 }39 {40 get { return commandText; }41 }42 public void Dispose()43 {44 connection.Dispose();45 }46 }47}48using System;49using System.Collections.Generic;50using System.Linq;51using System.Text;52using System.Threading.Tasks;53using NBi.Core.Query.Execution;54using System.Data.OleDb;55{56 {57 private readonly OleDbDataReader reader;58 public OleDbDataReader(OleDbDataReader reader)59 {60 this.reader = reader;61 }62 public bool Read()63 {64 return reader.Read();65 }66 public object GetValue(int i)67 {68 return reader.GetValue(i);69 }70 public void Dispose()71 {72 reader.Dispose();73 }74 }75}76using System;77using System.Collections.Generic;78using System.Linq;79using System.Text;80using System.Threading.Tasks;81using NBi.Core.Query.Execution;82using System.Data.OleDb;83{84 {85 private readonly OleDbCommand command;86 public OleDbCommand(OleDbCommand command)87 {88 this.command = command;89 }90 public void AddWithParameter(string parameterName, object

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1using System;2using System.Collections.Generic;3using System.Linq;4using System.Text;5using System.Threading.Tasks;6using NBi.Core.Query.Execution;7using NBi.Core.Query.Resolver;8using NBi.Core.Query.Resolver.Olap;9{10 {11 static void Main(string[] args)12 {13 var query = new OlapQuery("SELECT {[Measures].[Internet Sales Amount]} ON COLUMNS, {[Date].[Calendar].[Calendar Year].Members} ON ROWS FROM [Adventure Works]");14 var resolver = new OlapCommandResolver(query);15 resolver.Setup(connectionString, null);16 var engine = new OleDbExecutionEngine();17 var result = engine.Execute(resolver.Instantiate());18 }19 }20}

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1using System;2using System.Data;3using System.Data.OleDb;4using NBi.Core.Query.Execution;5using NBi.Core.Query;6using NBi.Core;7using NBi.Core.Query.Resolver;8using NBi.Core.Query.Command;9using NBi.Extensibility.Query;10{11 {12 static void Main(string[] args)13 {14 var connection = new OleDbConnection("Provider=SQLOLEDB;Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=SSPI");15 var command = new OleDbCommand("select * from [Person].[BusinessEntity]");16 var engine = new OleDbExecutionEngine();17 var result = engine.Execute(connection, command);18 foreach (DataRow row in result.Rows)19 {20 Console.WriteLine(row["BusinessEntityID"] + " " + row["RowGuid"]);21 }22 Console.ReadKey();23 }24 }25}26using System;27using System.Data;28using System.Data.OleDb;29using NBi.Core.Query.Execution;30using NBi.Core.Query;31using NBi.Core;32using NBi.Core.Query.Resolver;33using NBi.Core.Query.Command;34using NBi.Extensibility.Query;35{36 {37 static void Main(string[] args)38 {39 var connection = new OleDbConnection("Provider=SQLOLEDB;Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=SSPI");40 var command = new OleDbCommand("select * from [Person].[BusinessEntity]");41 var engine = new OleDbExecutionEngine();42 var result = engine.Execute(connection, command);43 foreach (DataRow row in result.Rows)44 {45 Console.WriteLine(row["BusinessEntityID"] + " " + row["RowGuid"]);46 }47 Console.ReadKey();48 }49 }50}51using System;52using System.Data;53using System.Data.OleDb;54using NBi.Core.Query.Execution;55using NBi.Core.Query;56using NBi.Core;57using NBi.Core.Query.Resolver;58using NBi.Core.Query.Command;59using NBi.Extensibility.Query;60{61 {62 static void Main(string

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1var engine = new OleDbExecutionEngine();2var result = engine.Execute("SELECT * FROM [Sheet1$]");3Console.WriteLine(result.Rows.Count);4var engine = new OleDbExecutionEngine();5var result = engine.Execute("SELECT * FROM [Sheet1$]", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=1.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES\"");6Console.WriteLine(result.Rows.Count);7var engine = new OleDbExecutionEngine();8var result = engine.Execute("SELECT * FROM [Sheet1$]", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=1.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES\"");9Console.WriteLine(result.Rows.Count);10var engine = new OleDbExecutionEngine();11var result = engine.Execute("SELECT * FROM [Sheet1$]", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=1.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES\"");12Console.WriteLine(result.Rows.Count);13var engine = new OleDbExecutionEngine();14var result = engine.Execute("SELECT * FROM [Sheet1$]", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=1.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES\"");15Console.WriteLine(result.Rows.Count);16var engine = new OleDbExecutionEngine();17var result = engine.Execute("SELECT * FROM [Sheet1$]", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=1.xlsx;Extended Properties=\"Excel 12.0 Xml;HDR=YES\"");18Console.WriteLine(result.Rows.Count);

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1public void Execute_OleDbExecutionEngine()2{3 var connectionString = "Provider=SQLNCLI11;Server=.;Database=AdventureWorks2012;Trusted_Connection=yes;";4 var query = "SELECT TOP 10 * FROM Person.Contact";5 var engine = new NBi.Core.Query.Execution.OleDbExecutionEngine(connectionString);6 var result = engine.Execute(query);7 Assert.IsNotNull(result);8}9public void Execute_SqlClientExecutionEngine()10{11 var connectionString = "Server=.;Database=AdventureWorks2012;Trusted_Connection=yes;";12 var query = "SELECT TOP 10 * FROM Person.Contact";13 var engine = new NBi.Core.Query.Execution.SqlClientExecutionEngine(connectionString);14 var result = engine.Execute(query);15 Assert.IsNotNull(result);16}17public void Execute_AdomdClientExecutionEngine()18{19 var connectionString = "Provider=MSOLAP;Data Source=.;Initial Catalog=AdventureWorksDW2012;Trusted_Connection=yes;";20 var query = "SELECT TOP 10 * FROM [AdventureWorksDW2012].[dbo].[Date]";21 var engine = new NBi.Core.Query.Execution.AdomdClientExecutionEngine(connectionString);22 var result = engine.Execute(query);23 Assert.IsNotNull(result);24}25public void Execute_OleDbExecutionEngine()26{27 var connectionString = "Provider=SQLNCLI11;Server=.;Database=AdventureWorks2012;Trusted_Connection=yes;";28 var query = "SELECT TOP 10 * FROM Person.Contact";29 var engine = new NBi.Core.Query.Execution.OleDbExecutionEngine(connectionString);30 var result = engine.Execute(query);31 Assert.IsNotNull(result);32}33public void Execute_OleDbExecutionEngine()34{35 var connectionString = "Provider=SQLNCLI11;Server=.;Database=AdventureWorks2012;Trusted_Connection=yes;";

Full Screen

Full Screen

OleDbExecutionEngine

Using AI Code Generation

copy

Full Screen

1var result = NBi.Core.Query.Execution.OleDbExecutionEngine.Execute("Provider=SQLOLEDB;Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=SSPI;Persist Security Info=False","SELECT * FROM [HumanResources].[Department]");2var result = NBi.Core.Query.Execution.OdbcExecutionEngine.Execute("Driver={SQL Server};Server=.;Database=AdventureWorks2012;Trusted_Connection=yes;","SELECT * FROM [HumanResources].[Department]");3var result = NBi.Core.Query.Execution.OdbcExecutionEngine.Execute("DSN=AdventureWorks2012;UID=sa;PWD=Password","SELECT * FROM [HumanResources].[Department]");4var result = NBi.Core.Query.Execution.OleDbExecutionEngine.Execute("Provider=SQLOLEDB;Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=SSPI;Persist Security Info=False","SELECT * FROM [HumanResources].[Department]");5var result = NBi.Core.Query.Execution.OdbcExecutionEngine.Execute("Driver={SQL Server};Server=.;Database=AdventureWorks2012;Trusted_Connection=yes;","SELECT * FROM [HumanResources].[Department]");6var result = NBi.Core.Query.Execution.OdbcExecutionEngine.Execute("DSN=AdventureWorks2012;UID=sa;PWD=Password","SELECT * FROM [HumanResources].[Department]");7var result = NBi.Core.Query.Execution.OleDbExecutionEngine.Execute("Provider=SQLOLEDB;Data Source=.;Initial Catalog=AdventureWorks2012;Integrated Security=SSPI;Persist Security Info=False","SELECT * FROM [HumanResources].[Department]");

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run NBi automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in OleDbExecutionEngine

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful