Home

"Fetching schema" message when no database code is being exercised

I was working with a short piece of C# code, and when I ran the code, a "fetching schema" message was displayed that took a really long while to time-out. After several tries, I realized that I had an invalid (out of date) connection (to a long-lost database that I no longer used). Deleting the connection fixed the problem, and the C# code ran fine afterwards. (And yes, it was the first time I had invoked LINQpad in a while.)

My question: Why is LINQpad even trying to fetch a schema when the C# code does not make use of any database?

I am running the very latest release.

Thank you.

Comments

  • In the toolbar, there's a dropdown for the connection. If you set that to something, it will try to fetch the schema for that database. I can only guess that you might have accidentally set this.

    You can clear it by setting the dropdown to 'None' or pressing Ctrl+D which toggles between the last-used connection and no connection.

  • edited April 2020

    Thank you. But why blindly try to establish the connection? Is it so that the connection will be ready when/if the script needs it?
    Maybe you could implement some sort of static verification that can be performed first, to see if there's something in the script that actually requires a connection? Just spitballing! :)

  • edited April 2020

    Also: Is there a forum setting somewhere that I may have missed that lets me know when there's a new post to the thread?

    I realize I am being a pain during these difficult times!

    Thank you again.

  • It makes a difference to error checking and autocompletion. Additional types and members become available when a connection is enabled. If there's an unresolved type or member in your script, it can't know whether it's because you mistyped something or because it relies a connection until the database schema has been fetched.

  • Regarding emailing you when a reply is posted, try Edit Profile > Notification Preferences.

Sign In or Register to comment.