Solved

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

Posted on 2011-03-24
3
351 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
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!
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

23 Experts available now in Live!

Get 1:1 Help Now