Questions tagged [idbcommand]
21 questions
0
votes
0 answers
.Net How to use commandtext instead of calling Stored proceduce and store it in a list with IDbConnection
I'm using stored procedures to get results from Sql database using IDbconnection. As an alternative of using stored procedures what are the other options to execute query inside the code?
If I use stored procedure, each machine must have it and in…

user3094480
- 43
- 1
- 8
0
votes
2 answers
NSubstitue for IDBCommand and error CA2100
I want substituting IDBCommand with using NSubstitue.
I must substitue field CommandText, and I did
string settedCommandText=string.Empty;
IDbCommand fakeCommand = Substitute.For();
command.CommandText =Arg.Do(x =>…

Alex
- 1
- 3
0
votes
1 answer
Passing parameters to IdbCommand for mySQL database
I am trying to do something relatively simple using IdbCommand to execute an insert query.
Here's the code:
using (IDbConnection conn = DbHelper.GetConnection(DbConnString))
using (IDbCommand com = conn.CreateCommand())
{
…

Nick
- 2,877
- 2
- 33
- 62
0
votes
1 answer
How to add parameters and execute a generic IDbCommand
Here is my problem in detail.
I have created a data access layer class that allows me to create most of objects I needed to communicate with databases (Odbc, OleDb and SqlClient). I also have created a business object handling layer class with…

Sam Saarian
- 992
- 10
- 13
-1
votes
1 answer
How can I prevent this code from disposing objects multiple times?
When I run a Code Analysis against the following code:
Protected Function GetOrderEntry() As IList(Of OE)
Dim results As IList(Of OE) = New List(Of OE)()
Using connection As IDbConnection =…

B. Clay Shannon-B. Crow Raven
- 8,547
- 144
- 472
- 862
-1
votes
2 answers
Read numeric data from oracle table in c#
I am trying to write c# function to read some data from oracle table
My functions:
public static writeConsole(string query, string connectionString, string driver)
{
//driver = Oracle.ManagedDataAccess.Client
using (var conn =…

Petr Ehler
- 23
- 5