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


C# OleDbCommand.Cancel方法代码示例

本文整理汇总了C#中System.Data.OleDb.OleDbCommand.Cancel方法的典型用法代码示例。如果您正苦于以下问题:C# OleDbCommand.Cancel方法的具体用法?C# OleDbCommand.Cancel怎么用?C# OleDbCommand.Cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.OleDb.OleDbCommand的用法示例。


在下文中一共展示了OleDbCommand.Cancel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test_Command_Cancel

        private static void Test_Command_Cancel()
        {
            using (OleDbCommand cmd = new OleDbCommand("select * from code;", conn))
            {
                cmd.ExecuteReader();
                cmd.Cancel();

                OleDbCommand cmd_clone = cmd.Clone();
                Assert.AreEqual(cmd.ToString(), cmd_clone.ToString());
            }
        }
开发者ID:CUBRID,项目名称:cubrid-oledb,代码行数:11,代码来源:TestOleDbCommand.cs

示例2: assignID_A

    /// <summary>
    /// 分配一级编码
    /// </summary>
    /// <param name="strIDType">编码规则编号</param>
    /// <returns>分配有效的编号</returns>
    public static string assignID_A(string strIDType)
    {
      OleDbConnection m_Conn = Conn.getConn();
      try
      {

        OleDbCommand m_Command = new OleDbCommand("pMaxID_A", m_Conn);

        m_Command.CommandType = CommandType.StoredProcedure;

        OleDbParameter param;

        param = m_Command.Parameters.Add("t", OleDbType.VarChar, 1);
        param.Direction = ParameterDirection.Input;
        param.Value = "";

        param = m_Command.Parameters.Add("strIDType", OleDbType.VarChar, 6);
        param.Direction = ParameterDirection.Input;
        param.Value = strIDType;

        param = m_Command.Parameters.Add("strMaxID", OleDbType.VarChar, 200);
        param.Direction = ParameterDirection.Output;

        m_Command.ExecuteNonQuery();

        string strRet = m_Command.Parameters["strMaxID"].Value.ToString();

        m_Command.Cancel();

        return strRet;

      }
      catch (Exception e)
      {
        throw e;
      }
      finally
      {
        m_Conn.Close();
      }
    }
开发者ID:windygu,项目名称:asxinyunet,代码行数:46,代码来源:NumAssign.cs

示例3: getAllSpell

    /// <summary>
    /// 获得汉字的全拼和简拼
    /// </summary>
    /// <param name="strWord">汉字</param>
    /// <param name="sSpell">传递出来的简拼</param>
    /// <param name="sAllSpell">传递出来的全拼</param>
    /// <returns>是否成功</returns>
    public static Boolean getAllSpell(string strWord,ref string sSpell,ref string sAllSpell)
    {
      OleDbConnection m_Conn = Conn.getConn();
      try
      {

        OleDbCommand m_Command = new OleDbCommand("GetAllSpell", m_Conn);

        m_Command.CommandType = CommandType.StoredProcedure;

        OleDbParameter param;

        param = m_Command.Parameters.Add("strRSpell", OleDbType.VarChar, 500);
        param.Direction = ParameterDirection.Output;

        param = m_Command.Parameters.Add("strRASpell", OleDbType.VarChar, 3000);
        param.Direction = ParameterDirection.Output;

        param = m_Command.Parameters.Add("strString", OleDbType.VarChar, 1000);
        param.Direction = ParameterDirection.Input;
        param.Value = strWord;

        m_Command.ExecuteNonQuery();

        sSpell = m_Command.Parameters["strRSpell"].Value.ToString();
        sAllSpell = m_Command.Parameters["strRASpell"].Value.ToString();

        m_Command.Cancel();
        return true;

      }
      catch (Exception e)
      {
        throw e;
      }
      finally
      {
        m_Conn.Close();
      }
    }
开发者ID:windygu,项目名称:asxinyunet,代码行数:47,代码来源:Spell.cs

示例4: ExecuteDataSet

        /// <summary>
        ///  执行带参数SQL语句
        /// </summary>
        public void ExecuteDataSet(string commandText, params object[] list)
        {
            OleDbCommand cmd = new OleDbCommand();
            cmd.Connection = getConn().get();
            cmd.CommandText = commandText;

            for (int i = 0; i < list.Length; i = i + 4)
            {
                string len = list[i + 2].ToString();
                int leng;
                if (len != "")
                    leng = Int32.Parse(len);
                else
                    leng = 255;

                cmd.Parameters.Add(list[i].ToString(), chtype(list[i + 1].ToString()), leng);
                cmd.Parameters[list[i].ToString()].Value = list[i + 3].ToString();
            }
            cmd.ExecuteNonQuery();
            cmd.Cancel();
            cmd.Connection.Close();
            cmd.Dispose();
            j_read_db_num++;
        }
开发者ID:joleye,项目名称:1.6,代码行数:27,代码来源:DbProvider.cs

示例5: Read


//.........这里部分代码省略.........
                                                        //LogFile2.Wrile2Log("Невозможно загрузить анкету из листа " + currentRow["TABLE_NAME"] + " - недопустимый УНП");

                                                    }

                                                }
                                                catch (ArgumentException argumentException)
                                                {
                                                    LogFile.Wrile2Log(argumentException.Message);
                                                    //LogFile2.Wrile2Log(argumentException.Message);
                                                }

                                                catch (Exception exp)
                                                {
                                                    LogFile.Wrile2Log(exp.Message + " Строка - " + currentRowXls +
                                                                      "\t Столбец - " + currentColumnXls);
                                                    //LogFile2.Wrile2Log(exp.Message + " Строка - " + currentRowXls +
                                                    //                  "\t Столбец - " + currentColumnXls);

                                                }

                                            }
                                        }

                                        y++;

                                    }

                                    j++;
                                }
                                catch (ArgumentException)
                                {
                                    dataReader.Close();
                                    dataReader.Dispose();
                                    selectCmd.Cancel();
                                    selectCmd.Dispose();
                                    throw;
                                }
                                catch (Exception e)
                                {

                                    //dataReader.Close();
                                    //dataReader.Dispose();
                                    //selectCmd.Cancel();
                                    //selectCmd.Dispose();
                                    //throw;

                                }

                            }
                            dataReader.Close();
                            dataReader.Dispose();

                            selectCmd.Cancel();
                            selectCmd.Dispose();

                            indexCurrentTable++;
                            if (typeAnkt == 1 && tableFound && tmpRowUl["name"].ToString().Length>1)
                            {

                                tmpRowUl["login"] = global::Excel2Ankets.Properties.Settings.Default.login;
                                tmpRowUl["file_name"] = currentFileName;
                                tmpRowUl["sheet_name"] = currentRow["TABLE_NAME"].ToString();
                                tmpRowUl["mfo"] = mfo;
                                tmpRowUl["pack_number"] = porc;
                                tmpTestDataSet.bd_org_t.Rows.Add(tmpRowUl);
                                bdOrgTTableAdapter.Update(tmpTestDataSet.bd_org_t);
开发者ID:alexander-gavrilov,项目名称:ussrmyprojects,代码行数:67,代码来源:XLSFile.cs


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