What are the steps in connecting to database?

Answer Posted / chaitanya.k

1. U need to declare name space according to which database
u need to connect.

2. U can declare connection string in two ways.

1. U can declare in web.config in appsettings.
2. U can delare directly in code behind or in inline code

These can delared by using connection string.

3. Then u can do the operations by open the connection.
4. After complete all ur transcations u need to close the
database.

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is method to get XML and schema from Dataset? getXML() and get Schema ()

751


What is difference between Dataview and Datatable?

729


What are the data access namespaces in .NET?

879


What is the functionality of data provider in ado.net?

669


What is linq and entity framework?

690


What is a data control clerk?

764


What is ado and rdo?

685


Why do we need ado.net?

725


What are the parameters that control most of connection pooling behaviors?

749


What are disadvantages of microsoft-provided data provider classes in ado.net?

739


How can we load multiple tables in to dataset?

793


What are the drawbacks of using ado.net?

707


Does sqlclient and oledb class share the same functionality?

710


What are the different execute methods of Ado.Net?

732


What are the advantages and drawbacks of using ado.net?

858