Class SqlStatement
Represents a sql statement.
Namespace: MySqlX.XDevAPI.Relational
Assembly: MySql.Data.dll
Version: 9.1.0
Syntax
public class SqlStatement : BaseStatement<SqlResult, string>
Constructors
SqlStatement(Session, String)
Initializes a new instance of the SqlStament class bassed on the session and sql statement.
Declaration
public SqlStatement(Session session, string sql)
Parameters
Type | Name | Description |
---|---|---|
Session | session | The session the Sql statement belongs to. |
System.String | sql | The Sql statement. |
Fields
parameters
Gets the list of parameters associated to this Sql statement.
Declaration
protected List<object> parameters
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Object> |
Properties
SQL
Gets the current Sql statement.
Declaration
public string SQL { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
Bind(Object[])
Binds the parameters values by position.
Declaration
public SqlStatement Bind(params object[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | values | The parameter values. |
Returns
Type | Description |
---|---|
SqlStatement | This SqlStatement set with the binded parameters. |
Execute()
Executes the current Sql statement.
Declaration
public override SqlResult Execute()
Returns
Type | Description |
---|---|
SqlResult | A SqlResult object with the resultset and execution status. |
Overrides
MySqlX.XDevAPI.Common.BaseStatement<MySqlX.XDevAPI.Relational.SqlResult, System.String>.Execute()