Connection Strings In Web.config File Using ASP.NET C#

Share:

Local Or Remote Sql Server Databse Connection String in configuration file (web.config)

LOCAL DATABASE SERVER

You don't need the username and password to access the local database server.

REMOTE DATABASE CONNECTION STRING WITH IP, USERNAME AND PASSWORD METHOD 1

EXAMPLE:

REMOTE DATABASE CONNECTION STRING WITH IP, USERNAME AND PASSWORD METHOD 2
EXAMPLE:

Writing the above database connection string in Web.config file as shown below
Now, write the below code to get the connection string from web.config file in your CS file.

Hi! I am Sartaj Husain. I am a Professional Software Developer, live in Delhi. I write blogs in my free time. I love to learn and share the knowledge with others because it is no good to try to stop knowledge from going forward. So free posts and tutorials. more..

No comments