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 different between sqlcommand object and command behavior object?

727


What is ado.net components?

675


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

685


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

799


What is ado code?

692


Explain executenonquery?

786


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

731


Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.

776


What is ado.net tutorial?

679


What is microsoft ado.net?

770


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?

756


What is the difference between ADO and ADO.Net?

801


how we can fire event in databound coulm in datagfrid withot using button?

736


Define the executescalar method?

672


What is openquery?

714