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

Share:
LOCAL DATABASE SERVER

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

REMOTE DATABASE SERVER/WITH USERNAME AND PASSWORD METHOD 1
You need the username and password to access the database from remote database server.

REMOTE DATABASE SERVER/WITH USERNAME AND PASSWORD METHOD 2

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