当前位置: 首页>>代码示例>>C#>>正文


C# SQLite.SQLiteStatement类代码示例

本文整理汇总了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;
        }
      }
    }
开发者ID:vertica-as,项目名称:sqlite-netFx-source-1.0.88.0,代码行数:43,代码来源:SQLiteStatement.cs

示例2: GetBytes

 internal abstract long GetBytes(SQLiteStatement stmt, int index, int nDataoffset, byte[] bDest, int nStart, int nLength);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例3: ColumnDatabaseName

 internal abstract string ColumnDatabaseName(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例4: ColumnAffinity

 internal abstract TypeAffinity ColumnAffinity(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例5: Bind_ParamName

 internal abstract string Bind_ParamName(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例6: Bind_ParamCount

 internal abstract int Bind_ParamCount(SQLiteStatement stmt);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例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);
              }
        }
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:38,代码来源:SQLiteBase.cs

示例8: GetText

 internal abstract string GetText(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例9: GetInt64

 internal abstract Int64 GetInt64(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例10: GetInt32

 internal abstract Int32 GetInt32(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例11: GetDouble

 internal abstract double GetDouble(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例12: GetDateTime

 internal abstract DateTime GetDateTime(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例13: GetChars

 internal abstract long GetChars(SQLiteStatement stmt, int index, int nDataoffset, char[] bDest, int nStart, int nLength);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例14: Bind_Int64

 internal abstract void Bind_Int64(SQLiteStatement stmt, int index, Int64 value);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs

示例15: Bind_Null

 internal abstract void Bind_Null(SQLiteStatement stmt, int index);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:1,代码来源:SQLiteBase.cs


注:本文中的System.Data.SQLite.SQLiteStatement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。