How to enable AUTODDL on Firebird using .NET Provider?
I need to enable AUTODDL in a Firebird embedded database from a C# App. Us开发者_如何转开发ing isql, it is as simple as executing:
SET AUTODDL ON;
but I'm not being able to execute that statement with a FbCommand. I'm getting the error:
Token unknown - line 1, column 5
AUTODDL
AUTOddl isn't a firebird command it's a isql command. iSql
Have you maybe though about executing the command using the process functoin.
public void Execute() {
Process p = new Process();
p.StartInfo.FileName = @"C:\Programme\Firebird2\bin\isql.exe";
p.StartInfo.Arguments = String.Format( " -q -user {0} -password {1} elias:{2} SET AUTOddl ON", user, password,"Database" );
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.Start();
}
Please note I havn't tested the above but it should work. If it doesn't you can try and put the sql script in a script file then execute the script file.
Parameters to execute script are as follows. -q -i c:\Scripts\CreateScript.sql
Hope this helps.
精彩评论