Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 580
  • Last Modified:

Find DB Connection String in Visual Studio 2011 Files

Hello experts,

I wrote a program on my local machine that has a database connection to a local SQL Server and database instance.  

However, when I move the program onto the client machine, it throws me a connectivity error saying it cannot connect to the database, because that set of db creds doesnt work on that new machine.

I want to simply hard-code the new server name and database creds into the program config file, because I could do that in VS 2008 in the web.config file, but in VS 2011 I cannot locate the config file that holds that information.

Does anyone know where that lives?  What file?  I dont have access to VS on the client system to be able to simply load it all up there and use the application to connect to the correct server and db.

Thanks!
0
robthomas09
Asked:
robthomas09
  • 3
  • 3
1 Solution
 
käµfm³d 👽Commented:
The configuration file should be in the same spot that it was in 2008. It is output right alongside the compiled executable. If you're creating a Forms or console application, the the output file's name will be "{YourExecutableName}.exe.config"; otherwise if you are creating a web application, the output file's name will be "web.config", just as it is within the solution.
0
 
robthomas09Author Commented:
Thanks for the reply!

I went to the directory where the exe is published and have attached a screenshot.  I dont have an .config files.   The other files appear to be encrypted or in a format notepad doesnt recognize too well.   I searched the entire directory for a *.exe.config file and one doesnt exist.  It's a Form report for sure - C#.

Any other ideas?

Thanks!
0
 
käµfm³d 👽Commented:
I don't see a screenshot  = )
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
robthomas09Author Commented:
Whoops!  Attached, sorry.shot
0
 
käµfm³d 👽Commented:
Ah. It appears that you're using ClickOnce deployment. This puts a copy of the configuration file into each user's profile folder (if they run the app). Try searching in "C:\Users\[username]\AppData\Local\Apps\2.0\[some random chars]\[some more random chars]\[a crazy name]" (Windows 7). For XP, the path will be slightly different.

 Screenshot
0
 
robthomas09Author Commented:
it was there - thanks!
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now