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


C# FbCommand.ExecuteNonQuery方法代码示例

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


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

示例1: atualizar

        public int atualizar(dsFROGIOS.FORNECEDORRow fornecedor)
        {
            FbCommand comando = null;
            string sql =
                "UPDATE FORNECEDOR "
                + "SET FORNECEDOR_ENDERECO = " + paramEndereco + ", "
                + "FORNECEDOR_BAIRRO = " + paramBairro + ", "
                + "FORNECEDOR_PERIMETRO = " + paramPerimetro + ", "
                + "FORNECEDOR_CIDADE = " + paramCidade + ", "
                + "FORNECEDOR_UF = " + paramUf + ", "
                + "FORNECEDOR_CEP = " + paramCep + ", "
                + "FORNECEDOR_TELEFONE = " + paramTelefone + ", "
                + "FORNECEDOR_CELULAR = " + paramCelular + ", "
                + "FORNECEDOR_EMAIL = " + paramEmail + ", "
                + "FORNECEDOR_OBSERVACOES = " + paramObservacoes + " "
                + "WHERE FORNECEDOR_CODIGO = " + paramCodigo + ";";

            comando = new FbCommand(sql, Conexao.getConexao, Conexao.getTransacao);
            comando.Parameters.AddWithValue(paramCodigo, fornecedor.FORNECEDOR_CODIGO);
            comando.Parameters.AddWithValue(paramEndereco, fornecedor.FORNECEDOR_ENDERECO);
            comando.Parameters.AddWithValue(paramBairro, fornecedor.FORNECEDOR_BAIRRO);
            comando.Parameters.AddWithValue(paramPerimetro, fornecedor.FORNECEDOR_PERIMETRO);
            comando.Parameters.AddWithValue(paramCidade, fornecedor.FORNECEDOR_CIDADE);
            comando.Parameters.AddWithValue(paramUf, fornecedor.FORNECEDOR_UF);
            comando.Parameters.AddWithValue(paramCep, fornecedor.FORNECEDOR_CEP);
            comando.Parameters.AddWithValue(paramTelefone, fornecedor.FORNECEDOR_TELEFONE);
            comando.Parameters.AddWithValue(paramCelular, fornecedor.FORNECEDOR_CELULAR);
            comando.Parameters.AddWithValue(paramEmail, fornecedor.FORNECEDOR_EMAIL);
            comando.Parameters.AddWithValue(paramObservacoes, fornecedor.FORNECEDOR_OBSERVACOES);

            return comando.ExecuteNonQuery();
        }
开发者ID:Artenes,项目名称:frogi-os,代码行数:32,代码来源:TblFornecedor.cs

示例2: SavePointTest

		public void SavePointTest()
		{
			FbCommand command = new FbCommand();

			Console.WriteLine("Iniciada nueva transaccion");

			Transaction = Connection.BeginTransaction("InitialSavePoint");

			command.Connection = Connection;
			command.Transaction = Transaction;

			command.CommandText = "insert into TEST (INT_FIELD) values (200) ";
			command.ExecuteNonQuery();

			Transaction.Save("FirstSavePoint");

			command.CommandText = "insert into TEST (INT_FIELD) values (201) ";
			command.ExecuteNonQuery();
			Transaction.Save("SecondSavePoint");

			command.CommandText = "insert into TEST (INT_FIELD) values (202) ";
			command.ExecuteNonQuery();
			Transaction.Rollback("InitialSavePoint");

			Transaction.Commit();
			command.Dispose();
		}
开发者ID:Outlivier,项目名称:FirebirdSql.Data.FirebirdClient,代码行数:27,代码来源:FbTransactionTests.cs

示例3: _executeNonQuery

        protected string _executeNonQuery(FbConnection conn, FbTransaction trans, string query, Dictionary<string, object> prms, bool isReturning)
        {
            string ret = "";

            using (FbCommand cmd = new FbCommand(query, conn, trans))
            {
                foreach (var prm in prms)
                    cmd.Parameters.AddWithValue(prm.Key, prm.Value);

                if (isReturning)
                {
                    FbParameter outparam = new FbParameter("@out", FbDbType.VarChar)
                    {
                        Direction = ParameterDirection.Output
                    };
                    cmd.Parameters.Add(outparam);

                    cmd.ExecuteNonQuery();
                    ret = outparam.Value as string;
                }
                else
                    cmd.ExecuteNonQuery();
            }

            return ret;
        }
开发者ID:kindprojects,项目名称:workstation,代码行数:26,代码来源:SCommand.cs

示例4: Cadastrar

        public void Cadastrar(Agendamento obj)
        {
            FbCommand sqlCommand = new FbCommand();

            try
            {
                sqlCommand.Connection = this._conexao;
                sqlCommand.CommandText = "INSERT INTO AGENDAMENTO (EMPRESA, FILIAL, FUNCIONARIO, CLIENTE,STATUS,DATAPREVISTO, " +
                                         "INICIOPREVISTO,FIMPREVISTO,TRASLADOPREVISTO, RESUMOAGENDAMENTO) " +
                                         "VALUES (@EMPRESA,@FILIAL,@FUNCIONARIO,@CLIENTE, @STATUS, @DATAPREVISTO, @INICIOPREVISTO, " +
                                         "@FIMPREVISTO,@TRASLADOPREVISTO, @RESUMOAGENDAMENTO)";
                sqlCommand.Parameters.AddRange(this.ParametrizarComando(obj));
                sqlCommand.ExecuteNonQuery();
            }
            catch (FbException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sqlCommand.Dispose();
            }
        }
开发者ID:PablusVinii,项目名称:OrdemServico,代码行数:27,代码来源:AgendamentoDAO.cs

示例5: AbortTransaction

        public void AbortTransaction()
        {
            FbTransaction transaction = null;
            FbCommand command = null;

            try
            {
                transaction = this.Connection.BeginTransaction();

                command = new FbCommand("ALTER TABLE \"TEST\" drop \"INT_FIELD\"", this.Connection, transaction);
                command.ExecuteNonQuery();

                transaction.Commit();
                transaction = null;
            }
            catch (Exception)
            {
                transaction.Rollback();
                transaction = null;
            }
            finally
            {
                if (command != null)
                {
                    command.Dispose();
                }
            }
        }
开发者ID:voloda,项目名称:firebird-NETProvider,代码行数:28,代码来源:FbTransactionTests.cs

示例6: Cadastrar

        public void Cadastrar(Projeto obj)
        {
            FbCommand sqlCommand = new FbCommand();

            try
            {
                sqlCommand.Connection = this._conexao;
                sqlCommand.CommandText = "INSERT INTO PROJETOS (CLIENTE, EMPRESA, FILIAL, HORASGERENTE, HORASCONSULTOR, HORASCOORDENADOR, DESCRICAO, META) " +
                                         "VALUES (@CLIENTE, @EMPRESA, @FILIAL, @HORAGERENTE, @HORACONSULTOR, @HORACOORDENADOR, @DESCRICAO, @META)";

                sqlCommand.Parameters.AddRange(this.ParametrizarComando(obj));
                sqlCommand.ExecuteNonQuery();
            }
            catch (FbException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sqlCommand.Dispose();
            }
        }
开发者ID:PablusVinii,项目名称:OrdemServico,代码行数:26,代码来源:ProjetoDAO.cs

示例7: btnCheck_Click

 private void btnCheck_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtPath.Text.Split('@').Length == 2)
         {
             FbConnectionStringBuilder cnString = new FbConnectionStringBuilder();
             cnString.DataSource = txtPath.Text.Split('@')[0];
             cnString.Database = txtPath.Text.Split('@')[1];
             cnString.UserID = "SYSDBA";
             cnString.Password = "masterkey";
             cnString.Charset = "win1251";
             cnString.Dialect = 3;
             using (FbConnection cn = new FbConnection(cnString.ToString()))
             {
                 cn.Open();
                 FbCommand cmd = new FbCommand("SELECT PRICE.* FROM PRICE", cn);
                 cmd.ExecuteNonQuery();
             }
             MessageBox.Show("ok");
         }
         else
         {
             MessageBox.Show("Не верный формат строки!");
         }
     }
     catch(Exception ex)
     {
         MessageBox.Show(ex.Message + "\n" + ex.Source);
     }
 }
开发者ID:slagovskiy,项目名称:psa,代码行数:31,代码来源:frmKioskItem.cs

示例8: CancelarNFseSistema

        public void CancelarNFseSistema(string sNumNfse, FbConnection Conn)
        {
            try
            {
                StringBuilder sSql = new StringBuilder();
                sSql.Append("update nf ");
                sSql.Append("set cd_recibocanc = '");
                sSql.Append("CANCELADA");
                sSql.Append("' ");
                sSql.Append("where ");
                sSql.Append("cd_empresa = '");
                sSql.Append(belStatic.codEmpresaNFe);
                sSql.Append("' ");
                sSql.Append("and ");
                sSql.Append("cd_numero_nfse = '");
                sSql.Append(sNumNfse);
                sSql.Append("'");
                using (FbCommand cmdUpdate = new FbCommand(sSql.ToString(), Conn))
                {
                    cmdUpdate.ExecuteNonQuery();
                }
            }
            catch (Exception ex)
            {
                throw;
            }

        }
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:28,代码来源:daoCancelamento.cs

示例9: Create

        public void Create(IEnumerable<string> columnDefinitions)
        {
            var sb = new StringBuilder();

            sb.Append("CREATE TABLE ");

            sb.Append(quoter.QuoteTableName(Name));
            sb.Append(" (");

            foreach (string definition in columnDefinitions)
            {
                sb.Append(definition);
                sb.Append(", ");
            }

            sb.Remove(sb.Length - 2, 2);
            sb.Append(")");

            var s = sb.ToString();

            using (var command = new FbCommand(s, Connection, Transaction))
                command.ExecuteNonQuery();

            processor.AutoCommit();

            processor.LockTable(Name);
        }
开发者ID:eloekset,项目名称:fluentmigrator,代码行数:27,代码来源:FirebirdTestTable.cs

示例10: BuscaCodigoEmpresas

        public List<string> BuscaCodigoEmpresas()
        {
            List<string> slCodigos = new List<string>();
            belConnection cx = new belConnection();

            try
            {
                using (FbCommand cmd = new FbCommand("Select empresa.cd_empresa from empresa order by empresa.cd_empresa", cx.get_Conexao()))
                {
                    cx.Open_Conexao();
                    cmd.ExecuteNonQuery();
                    FbDataReader dr = cmd.ExecuteReader();
                    while (dr.Read())
                    {
                        slCodigos.Add(dr["cd_empresa"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                cx.Close_Conexao();
            }

            return slCodigos;
        }
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:29,代码来源:daoEmpresa.cs

示例11: EliminarUsuarioPistola

        public bool EliminarUsuarioPistola(int AClave, out string AMensajeError)
        {
            bool pResult = true;
            AMensajeError = "";

            string pSentencia = "UPDATE DRASUSUAP SET ACTIVO='No' WHERE [email protected]";
            FbConnection con  = _Conexion.ObtenerConexion();

            FbCommand com = new FbCommand(pSentencia, con);
            com.Parameters.Add("@CLAVE", FbDbType.Integer).Value = AClave;

            try
            {
                con.Open();

                try
                {
                    com.ExecuteNonQuery();
                }
                catch(Exception ex)
                {
                    AMensajeError = ex.Message;
                    pResult = false;
                }
            }
            finally
            {
                if (con.State == System.Data.ConnectionState.Open){
                    con.Close();
                }
            }

            return pResult;
        }
开发者ID:jcsotoo92,项目名称:Grole2,代码行数:34,代码来源:UsuariosPersistencia.cs

示例12: InsertarLoteNoInventariable

        public LoteNoInventariable InsertarLoteNoInventariable(LoteNoInventariable ALote)
        {
            string pSentencia = "INSERT INTO LOTES_NO_INVENTARIABLES (LOTE) VALUES (@LOTE) RETURNING ID";
            FbConnection con = _Conexion.ObtenerConexion();

            FbCommand com = new FbCommand(pSentencia, con);
            com.Parameters.Add("@LOTE", FbDbType.Integer).Value = ALote.Lote;
            FbParameter pOutParameter = new FbParameter("@ID", FbDbType.Integer);
            pOutParameter.Direction = ParameterDirection.Output;
            com.Parameters.Add(pOutParameter);

            try
            {
                con.Open();
                com.ExecuteNonQuery();
            }
            finally
            {
                if (con.State == System.Data.ConnectionState.Open)
                {
                    con.Close();
                }
            }

            return ObtenerLote((int)pOutParameter.Value);
        }
开发者ID:jcsotoo92,项目名称:Grole,代码行数:26,代码来源:LotesNoInventariablesPersistencia.cs

示例13: atualizar

        public int atualizar(dsFROGIOS.CLIENTERow cliente)
        {
            FbCommand comando = null;
            string sql =
                "UPDATE CLIENTE "
                + "SET "
                + "CLIENTE_TIPO = " + paramTipo + ", "
                + "CLIENTE_TELEFONE = " + paramTelefone + ", "
                + "CLIENTE_CELULAR = " + paramCelular + ", "
                + "CLIENTE_EMAIL = " + paramEmail + ", "
                + "CLIENTE_ENDERECO = " + paramEndereco + ", "
                + "CLIENTE_BAIRRO = " + paramBairro + ", "
                + "CLIENTE_PERIMETRO = " + paramPerimetro + ", "
                + "CLIENTE_CIDADE = " + paramCidade + ", "
                + "CLIENTE_UF = " + paramUf + ", "
                + "CLIENTE_CEP = " + paramCep + " "
                + "WHERE CLIENTE_CODIGO = " + paramCodigo + ";";

            comando = new FbCommand(sql, Conexao.getConexao, Conexao.getTransacao);
            comando.Parameters.AddWithValue(paramCodigo, cliente.CLIENTE_CODIGO);
            comando.Parameters.AddWithValue(paramTipo, cliente.CLIENTE_TIPO);
            comando.Parameters.AddWithValue(paramTelefone, cliente.CLIENTE_TELEFONE);
            comando.Parameters.AddWithValue(paramCelular, cliente.CLIENTE_CELULAR);
            comando.Parameters.AddWithValue(paramEmail, cliente.CLIENTE_EMAIL);
            comando.Parameters.AddWithValue(paramEndereco, cliente.CLIENTE_ENDERECO);
            comando.Parameters.AddWithValue(paramBairro, cliente.CLIENTE_BAIRRO);
            comando.Parameters.AddWithValue(paramPerimetro, cliente.CLIENTE_PERIMETRO);
            comando.Parameters.AddWithValue(paramCidade, cliente.CLIENTE_CIDADE);
            comando.Parameters.AddWithValue(paramUf, cliente.CLIENTE_UF);
            comando.Parameters.AddWithValue(paramCep, cliente.CLIENTE_CEP);

            return comando.ExecuteNonQuery();
        }
开发者ID:Artenes,项目名称:frogi-os,代码行数:33,代码来源:TblCliente.cs

示例14: InsertarLoteSacrificio

        public CanalProgramado InsertarLoteSacrificio(CCall ACanal)
        {

            string pSentencia = "INSERT INTO DRASCCALL (GRANJA, LOTE, FECHA, CANALES) VALUES (@GRANJA, @LOTE, @FECHA, @CANALES) RETURNING CLAVE";
            FbConnection con = _Conexion.ObtenerConexion();

            FbCommand com = new FbCommand(pSentencia, con);
            com.Parameters.Add("@GRANJA", FbDbType.Integer).Value  = ACanal.Granja;
            com.Parameters.Add("@LOTE", FbDbType.VarChar).Value    = ACanal.Lote;
            com.Parameters.Add("@FECHA", FbDbType.Integer).Value   = ACanal.Fecha;
            com.Parameters.Add("@CANALES", FbDbType.Integer).Value = ACanal.Canales;

            FbParameter pOutParameter = new FbParameter("@CLAVE", FbDbType.Integer);
            pOutParameter.Direction = ParameterDirection.Output;
            com.Parameters.Add(pOutParameter);

            try
            {
                con.Open();
                com.ExecuteNonQuery();
            }
            finally
            {
                if (con.State == System.Data.ConnectionState.Open)
                {
                    con.Close();
                }
            }
            return ObtenerCanalProgramado((int)pOutParameter.Value);
        }
开发者ID:jcsotoo92,项目名称:Grole,代码行数:30,代码来源:CanalesPersistencia.cs

示例15: RetPrestadorEmail

        public string RetPrestadorEmail()
        {
            belConnection cx = new belConnection();

            try
            {
                string sMsgPadraoEmail = "{5}Razão Social:{1}{0}{5}E-mail: {2}{0}{5}CCM :{3}{0}{5}CNPJ:{4}{0}{0}";
                StringBuilder sQuery = new StringBuilder();
                sQuery.Append(" select empresa.cd_cgc, empresa.cd_inscrmu, empresa.cd_email, empresa.nm_empresa from empresa ");
                sQuery.Append(" where empresa.cd_empresa = '" + belStatic.codEmpresaNFe + "'");
                FbCommand Comand = new FbCommand(sQuery.ToString(), cx.get_Conexao());
                cx.Open_Conexao();
                Comand.ExecuteNonQuery();
                FbDataReader dr = Comand.ExecuteReader();
                dr.Read();
                objtcIdentificacaoPrestador = new tcIdentificacaoPrestador();

                return string.Format(sMsgPadraoEmail, "<br>",
                                            dr["nm_empresa"].ToString(),
                                            dr["cd_email"].ToString(),
                                            dr["cd_inscrmu"].ToString(),
                                            dr["cd_cgc"].ToString(), "    ");
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                cx.Close_Conexao();
            }
        }
开发者ID:dramosti,项目名称:GeraXml_2.0,代码行数:32,代码来源:daoPrestador.cs


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