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 sqldatareader?

487


What are the major difference between classic ADO and ADO.NET?

518


What is ado net stands for?

516


What is partial class?

550


Define atomicity?

575






What is Serialization in .NET? what are the types of Serialization?

553


What is the difference between Data adaptor and Data set?

513


What is ole in excel?

517


What are the connected and disconnected modes in ado.net?

487


What is sql command in ado net?

499


What are the namespaces used in ADO.Net to connect to a database?

599


What is the difference between a datareader and a dataset?

518


Which name space is used to get assembly details?

523


Explain the basic use of "dataview" and explain its methods.

529


What is namespace in ado.net?

496