473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C# Webservice database change

Sl1ver
196 100+
I've got a web service, atm the db path is hard coded into it, how will i set about making the db a string that can be changed and applied to where neccassery?
May 14 '09 #1
2 1933
cloud255
427 Expert 256MB
Look into config files.

These MSDN articles should get you started, feel free to post if you get stuck with the implementation:

How to add config files

Saving and retrieving data from a config file
May 14 '09 #2
Curtis Rutland
3,256 Expert 2GB
It really depends on what DB you are using, but your post leads me to believe it is some kind of portable DB like access...you should use the DataDirectory functionality. Put the DB in your App_Data folder, and use a connectionstring like this:
Expand|Select|Wrap|Line Numbers
  1. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\myDatabase.mdb;User Id=admin;Password=;
Note that the path starts from the DataDirectory. Also, this will help when you deploy your application.
May 14 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Martin | last post by:
Hey, I am currently writing a WebService ("Server") and a WinApp ("Client") so that a user can use a third program through the web. To do that the client needs a table from a database. Here...
5
by: Ron | last post by:
I have a bunch of Crystal Reports (v9) published as WebServices and use a ReportViewer to display the reports on the ASPNET page. Everytime we move the reports from dev to production we have to...
3
by: FeveZ | last post by:
I've been stuck on a problem now for ages and i'm about ready to pack my project in because of it lol. OK here is my scenario. I have an existing Crystal Report, which I have added to my...
8
by: kenneth fleckenstein nielsen | last post by:
hi guru's I want to restart my webservice when ever it throws an exception that isn't cought. can i do that by web.config or iss or how ??
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
8
by: Maxi | last post by:
Hello, i'm sorry my bad english :( I have CR9 Webservice, how to change databadse name and User_name into Webservice method? (not Viewer Control) Tks!! -- --------------------------
2
by: leonard.guillaume | last post by:
Hi again guys, I configured my MFC project so that it can call few webservices I made. The web services are in VB.Net and are using few namespace such as WebClientProtocol which I need in MFC....
1
by: Goose14 | last post by:
I have a client application and a webservice. Both are in the same solution. If I reference the local webservice and run, and step into the webservice no problem. My question is, when I want to...
6
by: Steve Ricketts | last post by:
I have a webservice written in VB.net that opens a connection to SQL Server 2000 with a connection string. The connection remains open for the life of the web service so the ADODB.connection is...
5
by: Jonathan Kay | last post by:
Hi, I'd like to my WCF webservice to work both on SSL and without. Unfortunately searching has led to dead ends, references to changes that only work on the old previous beta versions and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.