Solved

Find DB Connection String in Visual Studio 2011 Files

Posted on 2013-06-17
6
530 Views
Last Modified: 2013-06-17
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
Comment
Question by:robthomas09
  • 3
  • 3
6 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 39253770
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
 

Author Comment

by:robthomas09
ID: 39254024
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
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 39254063
I don't see a screenshot  = )
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:robthomas09
ID: 39254090
Whoops!  Attached, sorry.shot
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39254182
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
 

Author Comment

by:robthomas09
ID: 39254223
it was there - thanks!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is about my first experience with programming Arduino.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now