Explain the code behind steps to connect to a database

To connect to a database from code behind firstly we need to read the connection string provided in the web.config file and create a SQLConnection object using the same. The code is as follows:


In order to use this code the following directives needs to be added to the page:


Comments

Popular posts from this blog

jQuery Basics

What is the difference between a Page Layout and Master Page in SharePoint?

Accessing data from SharePoint 2010 to an ASP.NET application