Solved

how to add a config file in visual studio sql  server project

Posted on 2011-03-24
3
355 Views
Last Modified: 2012-06-27
I have created a sql server project in visual studio 2005 (C#).
in this project I have added a web Reference to a web service.
Now I need to figure our one way by which I can change service URL without recompiling the project and then regenerate the dlls.

some thing like adding the URL in config file
0
Comment
Question by:ziorinfo
3 Comments
 
LVL 2

Accepted Solution

by:
byfour earned 125 total points
ID: 35213130
Step1 : First create your App.config file, externally using a notepad
Step2: Right click on ur project and select ADD -> Existing Item and select the created app.config file by selecting all files under the file type.

I hope this will solve ur problem!
0
 

Expert Comment

by:angelalaw
ID: 35214360
I have worked with this before.  And the web reference when adding to the VS project will hook up to the service and create a soap type xml file that basically give the structure of the web service calls that can be made so the compiler knows.

So as long it is the SAME soap you can program it to change by doing this.

        APIref.PSAPIService apiService = new APIref.PSAPIService ();
        apiService.Url = <url>

APIRef is the alias name of the web service you added.
PSAPIService is the name that the web service is called
then assign the url.

Again to be clear the SOAP calls need to be identical otherwise it can produce errors.

We needed to do this so we could easily go from unit testing to qa testing to production servers with out a recompile.

Hope this helps.

0
 
LVL 1

Expert Comment

by:AVONFRS
ID: 35221444
You can right click your project in Visual Studio > Add New Item > Config File

It will automatically create a config file for you and then you add the necessary values.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!

856 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