connection string for a vb.net application to be deployed in random system

后端 未结 1 1000
栀梦
栀梦 2021-01-26 13:20

I am facing problem in using vb.net with sql server as DB.. Problem is of connection string i.e for \'n\' no. Of systems what shall be the connection string? App after geting de

1条回答
  •  余生分开走
    2021-01-26 13:52

    Below is a VB.Net code snippet to retrieve a connection string from the app.config. The project will need a reference to System.Configuration in order to use the ConfigurationManager.

    Dim connectionString As String=System.Configuration.ConfigurationManager.ConnectionStrings("myDatabase").ConnectionString
    

    An example App.Config:

    
        
            
        
    
    

    0 讨论(0)
提交回复
热议问题