On Monday, October 30, 2006 9:08 PM [GMT+1=CET],
Carlos Guzmán Álvarez <[EMAIL PROTECTED]> wrote:
Could you check if this works for you ??
using (FbConnection c = new
FbConnection(csb.ToString())) {
c.Open();
using (FbCommand command = new FbCommand("select *
from employee where (0=1)", c))
{
using (FbDataReader r =
command.ExecuteReader()) {
while (r.Read())
{
}
}
}
}
Yes, it works like a charm. I've provided you with a sample code in the
attachment which shows the problem. It only happens when I call Update
on my DataAdapter.
I have checked with Firebird 1.5 and it crashes exactly in the same
way. That's good news for me ;-)
Pierre
using System.Data;
using FirebirdSql.Data.FirebirdClient;
namespace FbUpdateTest
{
class Program
{
static void Main(string[] args)
{
string cs = "User=sysdba;Password=masterkey;Data
Source=localhost;Database=C:\\employee.firebird;Port=3050;Dialect=3;Packet
Size=8192;Server Type=0;Charset=UNICODE_FSS;Pooling=true;Connection Lifetime=2;";
using (FbConnection connection = new FbConnection (cs))
{
connection.Open ();
using (FbCommand command = new FbCommand ("select *
from employee where (0=1)", connection))
{
FbTransaction transaction =
BeginReadOnlyTransaction (connection);
FbDataAdapter adapter = new
FbDataAdapter (command);
FbCommandBuilder builder = new
FbCommandBuilder (adapter);
command.Transaction = transaction;
DataSet dataSet = new DataSet ();
adapter.MissingSchemaAction =
MissingSchemaAction.AddWithKey;
adapter.Fill (dataSet);
command.Transaction = null;
transaction.Commit ();
dataSet.Tables[0].Rows.Add (300, "Pierre", "Arnaud",
System.DBNull.Value, System.DateTime.Now, 622, "Eng", 5, "Switzerland", 0.0, "Arnaud, Pierre");
transaction = BeginReadWriteTransaction
(connection);
command.Transaction = transaction;
// Here comes the crash:
adapter.Update (dataSet); //
<----
transaction.Rollback ();
}
}
}
private static FbTransaction
BeginReadOnlyTransaction(FbConnection connection)
{
FbTransactionOptions options =
FbTransactionOptions.Concurrency |
/**/
FbTransactionOptions.Wait |
/**/
FbTransactionOptions.Read;
return connection.BeginTransaction (options);
}
private static FbTransaction
BeginReadWriteTransaction(FbConnection connection)
{
FbTransactionOptions options =
FbTransactionOptions.Concurrency |
/**/
FbTransactionOptions.Wait |
/**/
FbTransactionOptions.Write;
return connection.BeginTransaction (options);
}
}
}
-------------------------------------------------------------------------
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
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider