Solved

Find DB Connection String in Visual Studio 2011 Files

Posted on 2013-06-17
6
540 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 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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…

809 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