M
mmcd79
I built a VB.net application that makes use of a machine level DB
connection string setting, and a user level starting location setting.
The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.
This is all well and good. My issue is this:
I was testing something, and removed my app.exe.config file from the
directory that my application is in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).
I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!
The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.
connection string setting, and a user level starting location setting.
The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.
This is all well and good. My issue is this:
I was testing something, and removed my app.exe.config file from the
directory that my application is in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).
I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!
The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.