Solved

Find DB Connection String in Visual Studio 2011 Files

Posted on 2013-06-17
6
555 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 75

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 75

Expert Comment

by:käµfm³d 👽
ID: 39254063
I don't see a screenshot  = )
0
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

Author Comment

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

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
In this post we will learn different types of Android Layout and some basics of an Android App.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Introduction to Processes

734 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