Hi,

I'm using stored procedures in Firebird to do my DAO layer with Active
Record Pattern.

In this case, I have one stored procedure called SP_UNUFDAO,

Using the Command Object, when I do this code to Persist my Object on FB:

1 - FbCommand cmd = new FbCommand("SP_UNUFDAO",Connection);
2 - cmd.CommandType = CommandType.StoredProcedure;
3 - cmd.Parameters.Add("P_ACTION",FbDbType.Smallint).Value =
CrudAction.Persist.GetHashCode();
4 - cmd.Parameters.Add("P_ACRN",FbDbType.Char,2).Value = fd.Acronym;
5 - cmd.Parameters.Add("P_DESC",FbDbType.VarChar,50).Value = fd.Description;
6 - try
7 - {
8 -     cmd.Transaction = Connection.BeginTransaction();
9 -     cmd.ExecuteNonQuery();
10 -   cmd.Transaction.Commit();
11 - }
12 - catch(Exception e)
13 - {
14 -     throw new Exception(e.Message);
15 - }

One Exception raises at line 4, something like "Object Reference not set to
an instance of object"

What's wrong on my code?

I'm using Firebird 2.1, Mono, and .Net provider 2.51

thanks

-- 
João Dias de Carvalho Neto

http://www.jdiasneto.blogspot.com
jdias.bjsoftw...@gmail.com
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to