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

FbScript not loading and parsing the script file (Code missing) [DNET393] #397

Closed
firebird-automations opened this issue Sep 13, 2011 · 2 comments

Comments

@firebird-automations
Copy link

Submitted by: Antony Mellor (tonym1995)

The constructor for the FbScript class does not read the script file and therefore has nothing to parse.

// Constructor source code from 2.6.5

	public FbScript\(string script\)
	\{
		this\.results = new FbStatementCollection\(\);
		this\.parser = new StringParser\(RemoveComments\(script\), false\);
		this\.parser\.Token = ";";
	\}

// Constructor source code from 2.5.1 (which does work)

    public FbScript\(string sqlFilename\)
    \{
        string script = string\.Empty;

        using \(StreamReader reader = File\.OpenText\(sqlFilename\)\)
        \{
            script = reader\.ReadToEnd\(\);
        \}

        this\.results = new FbStatementCollection\(\);
        this\.parser = new StringParser\(RemoveComments\(script\), false\);
        this\.parser\.Token = ";";
    \}

After I installed the version 2.6.0 binaries the FbScript also did not work although I haven't checked the sources.

After compiling the 2.6.5 version with the StreamReader code in, it works again :-)

Enjoy you day!

@firebird-automations
Copy link
Author

Commented by: @cincuranet

That's correct. The ctor takes the script itself. If you wanna read it from file, you can use public static FbScript LoadFromFile(string fileName).

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

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