From: Pierre A. <pie...@op...> - 2003-10-06 09:28:29
|
>> I'd like to do the following using a single FbCommand object : >> >> "CREATE TABLE Test(ID INTEGER NOT NULL, >> REV INTEGER NOT NULL, >> DATA VARCHAR(100) CHARACTER SET UNICODE_FSS); >> >> ALTER TABLE Test ADD CONSTRAINT PK_TEST PRIMARY KEY (ID, REV);" [...] > You have two ways use the FbScript class, or use FbCommand.ExecuteReader > and FbDataReader.NextResult. Well, FbScript is not an option, since it does not have the IDbCommand interface. I'd like to be able to define the parameters for my multiple commands once, then let it execute everything in one call. The second solution, using ExecuteReader, almost works. It feels strange to have to use it, since both commands above don't return any results. Moreover, if I do : for (;;) { while (reader.Read ()) { ... } if (! reader.NextResult ()) break; } Then I get an exception on "Read", telling me "invalid request handle". If I drop the reader.Read (), then it will be OK. Why do I get an invalid request handle if the command has not produced any results ? I'd rather expect Read to return false. > Which version of the .NET Provider are you using ?? I am using assembly version 1.5.1333.25082. Pierre |