Solved

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

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

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