Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBValidation does not output any information as to success or failure of a requested Database Validation operation. [DNET399] #402

Closed
firebird-automations opened this issue Oct 24, 2011 · 1 comment

Comments

@firebird-automations
Copy link

Submitted by: Can A. Course (canacourse)

No exception is thrown either.

Sample code below.

private void ValidateDB(string Database)
{
FbConnectionStringBuilder ConnectionString = new FbConnectionStringBuilder();
ConnectionString.ServerType = FbServerType.Embedded;
ConnectionString.Database = Database;
ConnectionString.UserID = "sysdba";
ConnectionString.Password = "dummypassword"; // this is required
ConnectionString.Dialect = 3;

        try
        \{
            FbValidation DBValidator = new FbValidation\(\);
            DBValidator\.ConnectionString = ConnectionString\.ToString\(\);
            DBValidator\.Options = FbValidationFlags\.SweepDatabase; // or any other FBValidationFlags\.
            DBValidator\.ServiceOutput \+= ServiceOutput;
            DBValidator\.Execute\(\);
        \}
        catch \(Exception e\)
        \{
            Log\.FatalException\("Unable to validate Database", e\);
            Environment\.Exit\(0\);
        \}
       
    \}

private static void ServiceOutput(object sender, ServiceOutputEventArgs e) // never called
{
Log.Debug(e.Message);
}

@cincuranet
Copy link
Member

That's expected. FbValidation/sweep does not provide any output (it also does not have Verbose property). As long as no exception is thrown, you can assume it did not fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants