How would u connect to database using .NET?

Answer Posted / rajeev ranjan lall

SqlConnection conn = new SqlConnection("Data
Source=ServerName;Initial Calalog=DatabaseName;User
ID=username;Password=password")

Is This Answer Correct ?    15 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is aggregate root?

494


Which name space is used to get assembly details?

521


Why is stored procedure used in ado.net?

549


What is dbcontext and dbset in entity framework?

484


Explain how to bind the controls(best practice) comboboxes to the data in the dataset?

556






How to copy the contents from one table to another table and how to delete the source table in ado.net?

521


What are the various methods provided by the DataSet object to generate XML?

589


What is ado control?

524


What is the difference in an abstract class and an interface?

511


What is sqldatasource?

523


Which control of the BindingNavigator returns the current position within the data source?

729


Explain advantages of ado.net?

555


How to identify the updated rows in a dataset?

517


What is a data control clerk?

572


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

574