2using System.Data.Common;
4using System.Threading.Tasks;
18 private readonly OdbcCommand command;
19 private readonly
int nrParameters;
20 private readonly
string[] parameterNames;
26 this.command = Command;
27 this.nrParameters = this.command.Parameters.Count;
28 this.parameterNames =
new string[this.nrParameters];
29 this.parameterTypes =
new ArgumentType[this.nrParameters];
31 for (
int i = 0; i < this.nrParameters; i++)
33 this.parameterNames[i] = this.command.Parameters[i].ParameterName;
64 this.command?.Dispose();
88 await this.synchObj.BeginWrite();
91 for (i = 0; i < this.nrParameters; i++)
93 OdbcParameter Parameter = this.command.Parameters[i];
96 switch (Parameter.OdbcType)
101 case OdbcType.DateTime:
102 case OdbcType.Double:
106 case OdbcType.NVarChar:
107 case OdbcType.UniqueIdentifier:
108 case OdbcType.SmallDateTime:
110 case OdbcType.Timestamp:
111 case OdbcType.VarBinary:
112 case OdbcType.VarChar:
116 Parameter.Value = Value;
119 case OdbcType.Decimal:
120 case OdbcType.Numeric:
121 if (Value is decimal Decimal)
122 Parameter.Value = Decimal;
123 else if (Value is
double d)
124 Parameter.Value = (decimal)d;
126 Parameter.Value = Convert.ToDecimal(Value);
130 if (Value is
float Single)
131 Parameter.Value = Single;
132 else if (Value is
double d)
133 Parameter.Value = (float)d;
135 Parameter.Value = Convert.ToSingle(Value);
138 case OdbcType.SmallInt:
139 if (Value is Int16 Int16)
140 Parameter.Value = Int16;
141 else if (Value is
double d)
142 Parameter.Value = (Int16)d;
144 Parameter.Value = Convert.ToInt16(Value);
148 if (Value is Int32 Int32)
149 Parameter.Value = Int32;
150 else if (Value is
double d)
151 Parameter.Value = (Int32)d;
153 Parameter.Value = Convert.ToInt32(Value);
156 case OdbcType.BigInt:
157 if (Value is Int64 Int64)
158 Parameter.Value = Int64;
159 else if (Value is
double d)
160 Parameter.Value = (Int64)d;
162 Parameter.Value = Convert.ToInt64(Value);
165 case OdbcType.TinyInt:
166 if (Value is
byte UI8)
167 Parameter.Value = UI8;
168 else if (Value is
double d)
169 Parameter.Value = (byte)d;
171 Parameter.Value = Convert.ToByte(Value);
176 DbDataReader Reader = await this.command.ExecuteReaderAsync();
178 return await Reader.ParseAndClose();
182 await this.synchObj.EndWrite();
Represents an object that allows single concurrent writers but multiple concurrent readers....
Represents a stored precedure in an ODBC Database.
ArgumentType[] ArgumentTypes
Argument types.
async Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
Evaluates the lambda expression.
IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the lambda expression.
void Dispose()
IDisposable.Dispose
bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
override string ToString()
int NrArguments
Number of arguments.
string[] ArgumentNames
Argument Names.
override string ToString()
Basic interface for all types of elements.
object AssociatedObjectValue
Associated object value.
Base interface for lambda expressions.
ArgumentType
Type of parameter used in a function definition or a lambda definition.