• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SQLite.SQLiteStatement类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Data.SQLite.SQLiteStatement的典型用法代码示例。如果您正苦于以下问题:C# SQLiteStatement类的具体用法?C# SQLiteStatement怎么用?C# SQLiteStatement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SQLiteStatement类属于System.Data.SQLite命名空间,在下文中一共展示了SQLiteStatement类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: IsNull

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


示例17: Bind_ParamIndex

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


示例18: Prepare

 /// <summary>
 /// Prepares a SQL statement for execution.
 /// </summary>
 /// <param name="strSql">The SQL command text to prepare</param>
 /// <param name="previous">The previous statement in a multi-statement command, or null if no previous statement exists</param>
 /// <param name="strRemain">The remainder of the statement that was not processed.  Each call to prepare parses the
 /// SQL up to to either the end of the text or to the first semi-colon delimiter.  The remaining text is returned
 /// here for a subsequent call to Prepare() until all the text has been processed.</param>
 /// <returns>Returns an initialized SQLiteStatement.</returns>
 internal abstract SQLiteStatement Prepare(string strSql, SQLiteStatement previous, out string strRemain);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:10,代码来源:SQLiteBase.cs


示例19: Bind_Text

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


示例20: Reset

 /// <summary>
 /// Resets a prepared statement so it can be executed again.  If the error returned is SQLITE_SCHEMA, 
 /// transparently attempt to rebuild the SQL statement and throw an error if that was not possible.
 /// </summary>
 /// <param name="stmt">The statement to reset</param>
 /// <returns>Returns -1 if the schema changed while resetting, 0 if the reset was sucessful or 6 (SQLITE_LOCKED) if the reset failed due to a lock</returns>
 internal abstract int Reset(SQLiteStatement stmt);
开发者ID:ronnyMakhuddin,项目名称:SharperNLP,代码行数:7,代码来源:SQLiteBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SQLite.SQLiteTransaction类代码示例发布时间:2022-05-26
下一篇:
C# SQLite.SQLiteParameter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap