you have to add a key under the application settings section
ex:
<!-- application specific settings -->
<appSettings>
<add key="ConnectionString" value="server=you server;User ID=sa;pwd=passowrd;database=dbname" />
</appSettings>
Then you can call the connection string from any function or event from your app.
ex:
Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
where is application settings section is that my .config file do u mean?
will i be writing the following code in my .config file?
<!-- application specific settings -->
<appSettings>
<add key="ConnectionString" value="server=you server;User ID=sa;pwd=passowrd;database=dbname" />
</appSettings>
I don't want to hard code userid and password as user will providing them through a Login Screen in the application?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.