locked
Dyanamically Connection String RRS feed

  • Question

  • User-896252741 posted

    Hi

    I want to create dynamically Connection String .

    In the base of Login of User.

    Thanks

    Tuesday, September 17, 2013 2:13 PM

All replies

  • User-1360095595 posted

    So what problem are you facing? You can set the connection string in code when bulding the SqlConnection object.

    Refer: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring.aspx & http://www.connectionstrings.com/

    Tuesday, September 17, 2013 2:24 PM
  • User-896252741 posted

    hi

    I have more than one database and more than one client in single application.so I want In the basis of login user I want Create Dynamically Connection String.

    Thanks

    Tuesday, September 17, 2013 11:31 PM
  • User1196771204 posted

    Hi Javed,

    Do you mean that you want to just pass in the user credentials dynamically to your connection string? I apologize as I still do not get your intention for "dynamic connection string" 

    Wednesday, September 18, 2013 2:47 AM
  • User-896252741 posted

    No I want pass datasource,database,username,pwd from .cs page

    Wednesday, September 18, 2013 3:07 AM
  • User-1360095595 posted

    Did you read through the first link I provided in my previous reply? You can set the conneciton string in code including setting data source, database, username and pwd. Again, what's your problem; just do it.

    Wednesday, September 18, 2013 3:50 AM