本文整理汇总了C#中System.Data.SQLite.SQLiteStatement类的典型用法代码示例。如果您正苦于以下问题:C# SQLiteStatement类的具体用法?C# SQLiteStatement怎么用?C# SQLiteStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SQLiteStatement类属于System.Data.SQLite命名空间,在下文中一共展示了SQLiteStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SQLiteStatement
/// <summary>
/// Initializes the statement and attempts to get all information about parameters in the statement
/// </summary>
/// <param name="sqlbase">The base SQLite object</param>
/// <param name="flags">The flags associated with the parent connection object</param>
/// <param name="stmt">The statement</param>
/// <param name="strCommand">The command text for this statement</param>
/// <param name="previous">The previous command in a multi-statement command</param>
internal SQLiteStatement(SQLiteBase sqlbase, SQLiteConnectionFlags flags, SQLiteStatementHandle stmt, string strCommand, SQLiteStatement previous)
{
_sql = sqlbase;
_sqlite_stmt = stmt;
_sqlStatement = strCommand;
_flags = flags;
// Determine parameters for this statement (if any) and prepare space for them.
int nCmdStart = 0;
int n = _sql.Bind_ParamCount(this, _flags);
int x;
string s;
if (n > 0)
{
if (previous != null)
nCmdStart = previous._unnamedParameters;
_paramNames = new string[n];
_paramValues = new SQLiteParameter[n];
for (x = 0; x < n; x++)
{
s = _sql.Bind_ParamName(this, _flags, x + 1);
if (String.IsNullOrEmpty(s))
{
s = String.Format(CultureInfo.InvariantCulture, ";{0}", nCmdStart);
nCmdStart++;
_unnamedParameters++;
}
_paramNames[x] = s;
_paramValues[x] = null;
}
}
}
示例2: GetBytes
internal abstract long GetBytes(SQLiteStatement stmt, int index, int nDataoffset, byte[] bDest, int nStart, int nLength);
示例3: ColumnDatabaseName
internal abstract string ColumnDatabaseName(SQLiteStatement stmt, int index);
示例4: ColumnAffinity
internal abstract TypeAffinity ColumnAffinity(SQLiteStatement stmt, int index);
示例5: Bind_ParamName
internal abstract string Bind_ParamName(SQLiteStatement stmt, int index);
示例6: Bind_ParamCount
internal abstract int Bind_ParamCount(SQLiteStatement stmt);
示例7: GetValue
/// <summary>
/// Helper function to retrieve a column of data from an active statement.
/// </summary>
/// <param name="stmt">The statement being step()'d through</param>
/// <param name="index">The column index to retrieve</param>
/// <param name="typ">The type of data contained in the column. If Uninitialized, this function will retrieve the datatype information.</param>
/// <returns>Returns the data in the column</returns>
internal virtual object GetValue(SQLiteStatement stmt, int index, ref SQLiteType typ)
{
if (typ.Affinity == 0) typ = SQLiteConvert.ColumnToType(stmt, index);
if (IsNull(stmt, index)) return DBNull.Value;
Type t = SQLiteConvert.SQLiteTypeToType(typ);
switch (TypeToAffinity(t))
{
case TypeAffinity.Blob:
if (typ.Type == DbType.Guid && typ.Affinity == TypeAffinity.Text)
return new Guid(GetText(stmt, index));
int n = (int)GetBytes(stmt, index, 0, null, 0, 0);
byte[] b = new byte[n];
GetBytes(stmt, index, 0, b, 0, n);
if (typ.Type == DbType.Guid && n == 16)
return new Guid(b);
return b;
case TypeAffinity.DateTime:
return GetDateTime(stmt, index);
case TypeAffinity.Double:
return Convert.ChangeType(GetDouble(stmt, index), t, null);
case TypeAffinity.Int64:
return Convert.ChangeType(GetInt64(stmt, index), t, null);
default:
return GetText(stmt, index);
}
}
示例8: GetText
internal abstract string GetText(SQLiteStatement stmt, int index);
示例9: GetInt64
internal abstract Int64 GetInt64(SQLiteStatement stmt, int index);
示例10: GetInt32
internal abstract Int32 GetInt32(SQLiteStatement stmt, int index);
示例11: GetDouble
internal abstract double GetDouble(SQLiteStatement stmt, int index);
示例12: GetDateTime
internal abstract DateTime GetDateTime(SQLiteStatement stmt, int index);
示例13: GetChars
internal abstract long GetChars(SQLiteStatement stmt, int index, int nDataoffset, char[] bDest, int nStart, int nLength);
示例14: Bind_Int64
internal abstract void Bind_Int64(SQLiteStatement stmt, int index, Int64 value);
示例15: Bind_Null
internal abstract void Bind_Null(SQLiteStatement stmt, int index);