From: Timothy S. <tim...@ya...> - 2004-05-13 20:51:20
|
Hi, I cannot seem to use the NET provider to create and alter tables. Here is the code: string sqlstring = "create table testtable (testid int not null primary key)" FbTransaction txn = null; try { FbConnection conn = new FbConnection(connString); txn = conn.BeginTransaction(); cmd.Connection = conn; cmd.CommandText = sqlstring; cmd.Transaction = txn; int records_affected = cmd.ExecuteNonQuery(); #if FB_DEBUG FbDbFactory.Log("Executing the following Query: "); FbDbFactory.Log(cmd.CommandText); #endif if(records_affected > 0) { txn.Commit(); } else { txn.Rollback(); } return records_affected; } catch (Exception e) { FbDbFactory.LogException(e); return -1; } finally { pconn.Available = true; CleanupResources(ref cmd, ref txn); } When I attempt to run the code through the debugger, ExecuteNonQuery always returns -1. In addition, I get the following error in the CommandPlan property of the FbCommand: CommandPlan <error: an exception of type: {System.ArgumentOutOfRangeException} occurred> This also occurs when trying to execute the following command on an existing table: "alter table testtable add temp_no varchar(50)". Note that both of these sql statements work through isql. Is creating/altering tables not currently supported in the .NET provider? -Tim __________________________________ Do you Yahoo!? Yahoo! Movies - Buy advance tickets for 'Shrek 2' http://movies.yahoo.com/showtimes/movie?mid=1808405861 |