2using System.Data.SqlClient;
4using System.Threading.Tasks;
79 public override string[]
DefaultArgumentNames =>
new string[] {
"Host",
"Database",
"UserName",
"Password" };
106 string ConnectionString =
Arguments[0].AssociatedObjectValue?.
ToString() ??
string.Empty;
107 SqlConnection Connection;
113 Connection =
new SqlConnection(ConnectionString);
117 string Database =
Arguments[1].AssociatedObjectValue?.
ToString() ??
string.Empty;
119 ConnectionString =
"Data Source=" + ConnectionString +
";Initial Catalog=" + Database +
";Integrated Security=true";
120 Connection =
new SqlConnection(ConnectionString);
123 string UserName =
Arguments[1].AssociatedObjectValue?.
ToString() ??
string.Empty;
124 string Password =
Arguments[2].AssociatedObjectValue?.
ToString() ??
string.Empty;
125 SecureString Password2 =
new SecureString();
127 foreach (
char ch
in Password)
128 Password2.AppendChar(ch);
130 Password2.MakeReadOnly();
131 Connection =
new SqlConnection(ConnectionString,
new SqlCredential(UserName, Password2));
138 Password2 =
new SecureString();
140 foreach (
char ch
in Password)
141 Password2.AppendChar(ch);
143 Password2.MakeReadOnly();
145 ConnectionString =
"Data Source=" + ConnectionString +
";Initial Catalog=" + Database;
146 Connection =
new SqlConnection(ConnectionString,
new SqlCredential(UserName, Password2));
150 await Connection.OpenAsync();
Creates a connection to an external MS SQL database.
ConnectMsSql(ScriptNode ConnectionString, ScriptNode UserName, ScriptNode Password, int Start, int Length, Expression Expression)
Creates a connection to an external MS SQL database.
override bool IsAsynchronous
If the node (or its decendants) include asynchronous evaluation. Asynchronous nodes should be evaluat...
ConnectMsSql(ScriptNode Host, ScriptNode Database, ScriptNode UserName, ScriptNode Password, int Start, int Length, Expression Expression)
Creates a connection to an external MS SQL database.
ConnectMsSql(ScriptNode ConnectionString, int Start, int Length, Expression Expression)
Creates a connection to an external MS SQL database.
override IElement Evaluate(IElement[] Arguments, Variables Variables)
Evaluates the function.
override string FunctionName
Name of the function
override string[] DefaultArgumentNames
Default Argument names
override async Task< IElement > EvaluateAsync(IElement[] Arguments, Variables Variables)
Evaluates the function.
ConnectMsSql(ScriptNode Host, ScriptNode Database, int Start, int Length, Expression Expression)
Creates a connection to an external MS SQL database.
Manages a Microsoft SQL Server connection
Class managing a script expression.
Base class for multivariate funcions.
ScriptNode[] Arguments
Function arguments.
static readonly ArgumentType[] argumentTypes2Scalar
Two scalar parameters.
static readonly ArgumentType[] argumentTypes3Scalar
Three scalar parameters.
static readonly ArgumentType[] argumentTypes1Scalar
One scalar parameter.
static readonly ArgumentType[] argumentTypes4Scalar
Four scalar parameters.
Base class for all nodes in a parsed script tree.
int Length
Length of expression covered by node.
override string ToString()
Expression Expression
Expression of which the node is a part.
int Start
Start position in script expression.
Basic interface for all types of elements.