DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    134

    Connection to SQL

    Hi,
    I am using VB.NET to create an application with SQL Server as backend. I have read some articles on putting the connection string in a config or xml file so that the database location can be easily changed in future. But I dont know how to go about it.
    I also wish to create more than one application that uses the same database. These different applications will be used by more than one user at the same time. How can I go about this? Please help.

    Thanks

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    in your config file under the <configuration> xml tag
    you can something like this
    <appSettings>
    <add key="connString" value="your connection string refer msdn"/>
    </appSettings>

    In your code import System.Configuration namespace
    then access this string ConfigurationSettings.AppSettings["connString"]
    and then use to do the database connection
    Sri

Similar Threads

  1. find version & service packs
    By rperez in forum Database
    Replies: 5
    Last Post: 01-02-2009, 04:14 PM
  2. Replies: 0
    Last Post: 04-29-2002, 07:43 AM
  3. Access & SQL Server
    By David Jones in forum Database
    Replies: 0
    Last Post: 08-31-2001, 12:22 PM
  4. Replies: 0
    Last Post: 01-12-2001, 11:20 AM
  5. Re: ODBC error
    By Devaraj in forum Enterprise
    Replies: 0
    Last Post: 05-11-2000, 12:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links