Hi Pham,

I was also never able to get backing up, restoring, fixing etc. to work 
*reliably* in FB Embedded / .NET Provider. Thread.Sleep(10000) can't be a 
solution, you never know how long you'd have to wait.

Here's a working! workaround:

* Download Firebird Server
* Extract gfix.exe and gbak.exe to your app's directory
* Create a copy of fbembed.dll and rename it to fbclient.dll

You can now call gfix.exe and gbak.exe on the command line, they will use FB 
Embedded internally. Now you can start those processes with .NET's 
Process.Start(ProcessStartInfo). Set UseShellExecute to false and 
CreateNoWindow to true.

Gbak.exe will write to StdOut (which you can read via OutputStream) and return 
error code 0 if everything is OK. Gfix.exe will write to StdErr if any problems 
occur.

Hope this helps.

Stefan


-----Ursprüngliche Nachricht-----
Von: Pham Huu Le quoc phuc [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 15. November 2008 14:23
An: For users and developers of the Firebird .NET providers
Betreff: [Firebird-net-provider] Unable restore database in Embedded mode

Hi all,

I try to restore a backup file, see following code, .Net provider can’t restore 
but 
when I add line System.Threading.Thread.Sleep(10000) then it’s OK.

FirebirdSql.Data.Services.FbRestore FbRestore = new 
FirebirdSql.Data.Services.FbRestore
();
FbRestore.BackupFiles.Add(new 
FirebirdSql.Data.Services.FbBackupFile(BackupFile, 
4096));
FbRestore.ConnectionString = _ConnectionString;
FbRestore.Options = FirebirdSql.Data.Services.FbRestoreFlags.Replace;
FbRestore.Execute();
System.Threading.Thread.Sleep(10000);

In Firebird 2.1, .Net Provider 2.5 Alpha


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Firebird-net-provider mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to