Connection String

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raamay
    New Member
    • Feb 2007
    • 107

    Connection String

    Code:
    Connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\POS.mdb"
    Code:
    Connection.ConnectionString = "DSN=db"
    Hi experts, i don't understand how to make our connection string dynamic. With it i mean, only the second method above (with use of DSN) i can do that. Whereas, in the first method i have to hardcode the connection string which i don't want to do. I would want to setup a connection string such that whatever the database may be, when i install the application i should have flexibility to define the connection.
    Example:
    Code:
    "Provider=" + providername + ";Data Source=" + datasource + ";Username=" + username + ";Password=" + password
    HOW CAN I ACHIEVE THIS??? WHAT IS THE STANDARD METHOD FOLLOWED TO ACHIEVE THIS???
Working...