DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Martin Guest

    ADO.net Connection String


    have a login form in which I want to enter the UserID and Password and then
    pass it as a parameter for ADODB connection string.

    here is the code:

    Dim cn As New ADODB.Connection()
    cn.ConnectionString = "provider=sqloledb;server=66.134.31.35;database=northwind;uid=sa"
    cn.Open()


  2. #2
    Jim Ferguson Guest

    Re: ADO.net Connection String

    I'm not sure what the question is here? Typically you can store the
    value (best if encrypted) in your app.config file, and then use the
    built-in Configuration object to retrieve the value:

    In your app.config file:

    <appSettings>
    <add key="connectionstring" value = "Data Source=servername;user
    id=sa;password=xxx;Initial Catalog=tttt"/>
    </appSettings>

    To retrieve value, import system.configuration, and use code like:

    dim conString as string =
    ConfigurationSettings.AppSettings("ConnectionString")

    -- Jim F.


    >have a login form in which I want to enter the UserID and Password and then
    >pass it as a parameter for ADODB connection string.
    >
    >here is the code:
    >
    > Dim cn As New ADODB.Connection()
    > cn.ConnectionString = "provider=sqloledb;server=66.134.31.35;database=northwind;uid=sa"
    > cn.Open()


    -- Jim F.
    http://www.fmsinc.com

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