Can we have Common Connection String in ASP.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidson1
    New Member
    • Feb 2008
    • 144

    Can we have Common Connection String in ASP.NET

    Hai Friends,

    I have a Question , Actually in My Project I am Having Nearly more than 50 Webforms , My Backend is Sql server 2000 , in the future i want to change Oracle...Then I have to Change Connection String for .... in more than 50 webforms it really irritating....

    So there is any option to put this ConnectionStrin g in commonPlace and call whenever Necessary.....l ike a function in C , So that I can Change Easily.... if You have any idea Pl Reply me.......

    i have the following code.....

    dim cn As New System.Data.sql client.SqlConne ction

    cn.ConnectionSt ring = "Persist Security Info=False;User ID=sa;Initial Catalog=master; password=david; "

    cn.Open()



    Davidson

    2 March 2008...
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Place your connection strings in the web.config and think about using classes. HTH.

    Comment

    Working...