From: olegmad <ol...@ya...> - 2003-10-21 09:00:48
|
Hello Carlos! I am have probler with FbCommandBuilder.DeriveParameters() too. I create this procedure: -------------------------------------------- CREATE PROCEDURE MYPROC RETURNS ( "id" INTEGER) AS begin "id" = 777; end -------------------------------------------- And this code: -------------------------------------------- using System; using System.Data; using System.Data.Common; using FirebirdSql.Data.Firebird; namespace ConsoleApplication { class MainClass { static private readonly string ConnectionString = @"Server=80.80.104.12;Database=c:\temp\carlos.gdb;Charset=UNICODE_FSS;Connec tion Lifetime=15;Dialect=3;User=carlos;Password=carlos;"; static void Main(string[] args) { FbConnection connection = new FbConnection(ConnectionString); connection.Open(); FbTransaction transaction = connection.BeginTransaction(); FbCommand command = new FbCommand("MYPROC", connection, transaction); command.CommandType = CommandType.StoredProcedure; FbCommandBuilder.DeriveParameters(command); transaction.Commit(); connection.Close(); } } } -------------------------------------------- I catch exception: Unhandled Exception: FirebirdSql.Data.Firebird.FbException: Execute requires the Command object to have a Transaction object when the Connection object assigned to the command is in a pending local transaction. The Transaction property of the Command has not been initialized. at FirebirdSql.Data.Firebird.DbSchema.FbAbstractDbSchema.GetDbSchemaTable(FbCon nection connection, Object[] restrictions) at FirebirdSql.Data.Firebird.FbConnection.GetDbSchemaTable(FbDbSchemaType schema, Object[] restrictions) at FirebirdSql.Data.Firebird.FbCommandBuilder.DeriveParameters(FbCommand command) at ConsoleApplication.MainClass.Main(String[] args) in c:\vss\consoleapplication3\class1.cs:line 21 Thanks. |
From:
<car...@te...> - 2003-10-21 10:08:22
|
Hello: Fixed in CVS, you can use it without start a transaction and it will work ok or get latest CVS sources, i ahave added a nunit test case too. -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: olegmad <ol...@ya...> - 2003-10-21 14:27:43
|
> Fixed in CVS, you can use it without start a transaction and > it will work ok or get latest CVS sources, i ahave added a > nunit test case too. I get lastest CVS sources, but problem not fixed. That code work fine, but if I uncomment one line - exception will throw. using System; using System.Data; using System.Data.Common; using FirebirdSql.Data.Firebird; namespace ConsoleApplication { class MainClass { static private readonly string ConnectionString = @"Server=80.80.104.12;Database=c:\temp\carlos.gdb;Charset=UNICODE_FSS;Connec tion Lifetime=15;Dialect=3;User=carlos;Password=carlos;"; static void Main(string[] args) { FbConnection connection = new FbConnection(ConnectionString); connection.Open(); FbCommand command = new FbCommand("MYPROC", connection); //command.Transaction = connection.BeginTransaction(); // if uncomment THIS line - generate exception :( command.CommandType = CommandType.StoredProcedure; FbCommandBuilder.DeriveParameters(command); connection.Close(); } } } |
From:
<car...@te...> - 2003-10-21 16:28:19
|
Hello: > I get lastest CVS sources, but problem not fixed. It's working for me, are you sure you have got the latest CVS sources ?? Here is my sample code: FbConnection connection = new FbConnection(connectionString); connection.Open(); FbTransaction transaction = connection.BeginTransaction(); FbCommand command = new FbCommand("GETVARCHARFIELD", connection, transaction); command.CommandType = CommandType.StoredProcedure; FbCommandBuilder.DeriveParameters(command); transaction.Commit(); connection.Close(); -- Best regards Carlos Guzmán Álvarez Vigo-Spain |
From: olegmad <ol...@ya...> - 2003-10-23 10:19:31
|
> It's working for me, are you sure you have got the latest CVS sources ?? Probably it's my bug, sorry :( I download last CVS. Now it works. Great thanks!!! :) Bye. |
From:
<car...@te...> - 2003-10-23 10:56:24
|
Hello: > Probably it's my bug, sorry :( No problem, probably was only the CVS update delay :) for pserver connections. > I download last CVS. Now it works. Great thanks!!! :) Great !! :) -- Best regards Carlos Guzmán Álvarez Vigo-Spain |