Subject Re: [firebird-support] Firebird stored procedure
Author Dean Harding
Lin XG wrote:
> I'm using VB.NET. Here is what my code looks like.
>
> XFER_CONDITION = "A string that can also be NULL"
>
> FB_DbCommand = New FbCommand("MY_QUERY",
> FB_DbConnection)
> FB_DbCommand.CommandType = CommandType.StoredProcedure
> FB_DbCommand.Parameters.Add("@xfer_condition",
> XFER_CONDITION)
>
> FB_DbCommand.ExecuteNonQuery()
>
> It works fine but I am not how to deal with the
> possibility of my paramater being NULL.

Looks like it'll work fine just as is. I would suggest that instead of
Add, you use AddWithValue, as in:

FB_DbCommand.Parameters.AddWithValue("@xfer_condition", XFER_CONDITION)

Because passing the actual value to the Add() method can cause trouble
with certain parameter type combinations.

Also, if you want to pass numeric types as NULL, you can pass
DbNull.Value in as the parameter value.

Dean.