Show / Hide Table of Contents

Method sqlite.Get(+ 6 overloads)


Overload

Executes single SQL statement and gets single value.

public bool Get(out int value, string sql, params object[] bind)
Parameters
value  (int)

Receives data.

sql  (string)

Single SQL statement.

bind  (object[])

Values that will replace ? characters in sql. Read about SQL parameters in SQLite website. Supported types: sqliteStatement.BindAll. Example: sqlite.

Returns
bool

false if the statement returned no data.

Exceptions
SLException

Failed.

NotSupportedException

sql contains more than single SQL statement.

Remarks

Also can be used to get uint, short, ushort, byte, sbyte, enum. Will need to cast from int.


Overload(next)

Executes single SQL statement and gets single value.

public bool Get(out long value, string sql, params object[] bind)
Parameters
value  (long)

Receives data.

sql  (string)

Single SQL statement.

bind  (object[])

Values that will replace ? characters in sql. Read about SQL parameters in SQLite website. Supported types: sqliteStatement.BindAll. Example: sqlite.

Returns
bool

false if the statement returned no data.

Exceptions
SLException

Failed.

NotSupportedException

sql contains more than single SQL statement.

Remarks

Also can be used to get ulong, 64-bit enum, maybe DateTime.


Overload(next)

Executes single SQL statement and gets single value.

public bool Get(out bool value, string sql, params object[] bind)
Parameters
value  (bool)

Receives data.

sql  (string)

Single SQL statement.

bind  (object[])

Values that will replace ? characters in sql. Read about SQL parameters in SQLite website. Supported types: sqliteStatement.BindAll. Example: sqlite.

Returns
bool

false if the statement returned no data.

Exceptions
SLException

Failed.

NotSupportedException

sql contains more than single SQL statement.


Overload(next)

Executes single SQL statement and gets single value.

public bool Get(out double value, string sql, params object[] bind)
Parameters
value  (double)

Receives data.

sql  (string)

Single SQL statement.

bind  (object[])

Values that will replace ? characters in sql. Read about SQL parameters in SQLite website. Supported types: sqliteStatement.BindAll. Example: sqlite.

Returns
bool

false if the statement returned no data.

Exceptions
SLException

Failed.

NotSupportedException

sql contains more than single SQL statement.

Remarks

Also can be used to get float.


Overload(next)

Executes single SQL statement and gets single value.

public bool Get(out string value, string sql, params object[] bind)
Parameters
value  (string)

Receives data.

sql  (string)

Single SQL statement.

bind  (object[])

Values that will replace ? characters in sql. Read about SQL parameters in SQLite website. Supported types: sqliteStatement.BindAll. Example: sqlite.

Returns
bool

false if the statement returned no data.

Exceptions
SLException

Failed.

NotSupportedException

sql contains more than single SQL statement.


Overload(next)

Executes single SQL statement and gets single value.

public bool Get<T>(out T[] value, string sql, params object[] bind) where T : unmanaged
Parameters
value  (T[])

Receives data.

sql  (string)

Single SQL statement.

bind  (object[])

Values that will replace ? characters in sql. Read about SQL parameters in SQLite website. Supported types: sqliteStatement.BindAll. Example: sqlite.

Returns
bool

false if the statement returned no data.

Exceptions
SLException

Failed.

NotSupportedException

sql contains more than single SQL statement.

Type Parameters
T

Overload(top)

Executes single SQL statement and gets single value.

public bool Get<T>(out List<T> value, string sql, params object[] bind) where T : unmanaged
Parameters
value  (List<T>)

Receives data.

sql  (string)

Single SQL statement.

bind  (object[])

Values that will replace ? characters in sql. Read about SQL parameters in SQLite website. Supported types: sqliteStatement.BindAll. Example: sqlite.

Returns
bool

false if the statement returned no data.

Exceptions
SLException

Failed.

NotSupportedException

sql contains more than single SQL statement.

Type Parameters
T