From: Carlos G. A. <car...@te...> - 2003-04-09 15:06:31
|
Hello: > Can we not execute a whole script that has many statements, e.g. > > CREATE DOMAIN .... ; > CREATE DOMAIN .... ; > CREATE TABLE .... ; You can do anything like this: FbConnection connection = new FbConnection(connectionString); connection.Open(); FbTransaction transaction = connection.BeginTransaction(); StringBuilder batchCommand = new StringBuilder(); batchCommand.Append("CREATE DOMAIN LOGICO AS SMALLINT DEFAULT 0;"); batchCommand.Append("CREATE DOMAIN NIF AS CHAR(10) DEFAULT '';"); batchCommand.Append("CREATE DOMAIN ID AS INTEGER DEFAULT 0"); FbCommand command = new FbCommand(batchCommand.ToString(), connection, transaction); FbDataReader reader = command.ExecuteReader(); while ( reader.NextResult() ) { } reader.Close(); transaction.Commit(); connection.Close(); -- Best regards Carlos Guzmán Álvarez Vigo-Spain |