Are you adding your parameters in the same order they’re specified in the execute statement?

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fabio Gomes
Sent: Thursday, July 20, 2006 8:13 AM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Executing Stored Procedures,

 

I m adding it to the code, but it doesnt work, here all my code:

      public static bool ExecutarProcedure(string sql, List<Parametro> Parameters, IDbConnection cn, IDbTransaction tr)
      {
          FbConnection _cn = (FbConnection)cn;
          FbTransaction _tr = (FbTransaction)tr;
          FbCommand cmd = new FbCommand();
          cmd.CommandType = CommandType.StoredProcedure;
          cmd.CommandText = sql;         
          cmd.Connection = _cn;
          if (tr != null)
              cmd.Transaction = _tr;
          foreach (Parametro par in Parameters)
          {
              cmd.Parameters.AddWithValue(par.nome, par.valor);
          }         
          return (cmd.ExecuteNonQuery() > 0);
      }

On 7/20/06, Le roy Arnaud <[EMAIL PROTECTED]> wrote:

hello try to this :
cmd.CommandType = CommandType.StoredProcedure;



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to