Connection to SQL


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Connection to SQL

  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, 05:14 PM
  2. Replies: 0
    Last Post: 04-29-2002, 08:43 AM
  3. Access & SQL Server
    By David Jones in forum Database
    Replies: 0
    Last Post: 08-31-2001, 01:22 PM
  4. Replies: 0
    Last Post: 01-12-2001, 12:20 PM
  5. Re: ODBC error
    By Devaraj in forum Enterprise
    Replies: 0
    Last Post: 05-11-2000, 01:48 PM

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center