Hi Carlos.

What you can't see is that I used the using statement witch calls the dispose method of the FbCommand object and as far as I can tell that has not been implemented.

This doesn't work:
                using (command)
                {
                    // make sure that there is no loaded parameters before adding new ones
                    command.Parameters.Clear();
                    for (UInt16 i = 0; i < parameters.Length ; i++)
                    {
                        if (parameters[i] != null)
                        {
                            // insert the database depended parameter prefix if the implementation
                            // haven't supplied it with the parameter name (can be set at the top of
                            // the class).
                            if (parameters[i].ParameterName.IndexOf(SQLPARAMETERPREFIX) != 0)
                                parameters[i].ParameterName = SQLPARAMETERPREFIX + parameters[i].ParameterName;
                            command.Parameters.Add(parameters[i]);
                        }
                    }
                    command.CommandText = SQLReader.Load(queryname);

                    if ( command.CommandText.Length == 0)
                        throw new Exception("SQL statement \"" + queryname + "\" not found.");

                    command.CommandType = CommandType.Text ;
                    command.Connection = connection;
                    command.Connection.Open();
                    dt.Load(command.ExecuteReader(CommandBehavior.CloseConnection));
                }

This works:
                // make sure that there is no loaded parameters before adding new ones
                command.Parameters.Clear();
                for (UInt16 i = 0; i < parameters.Length; i++)
                {
                    if (parameters[i] != null)
                    {
                        // insert the database depended parameter prefix if the implementation
                        // haven't supplied it with the parameter name (can be set at the top of
                        // the class).
                        if (parameters[i].ParameterName.IndexOf(SQLPARAMETERPREFIX) != 0)
                            parameters[i].ParameterName = SQLPARAMETERPREFIX + parameters[i].ParameterName;
                        command.Parameters.Add(parameters[i]);
                    }
                }
                command.CommandText = SQLReader.Load(queryname);

                if (command.CommandText.Length == 0)
                    throw new Exception("SQL statement \"" + queryname + "\" not found.");

                command.CommandType = CommandType.Text;
                command.Connection = connection;
                command.Connection.Open();
                dt.Load(command.ExecuteReader(CommandBehavior.CloseConnection));

On 7/10/06, Carlos Guzmán Álvarez <[EMAIL PROTECTED]> wrote:
Hello:
> I get an IscException error when I run this code a second time. Note
> that it works perfect the first time but not the second.
Can you send the exception details ??
Can you send a test case ??




--
Carlos Guzmán Álvarez
Vigo-Spain

http://carlosga.blogspot.com/

No hay un solo rey que no descienda de un esclavo,
ni un esclavo que no haya tenido reyes en su familia.



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to