Home > DeveloperSection > Blogs > Database Connection

Database Connection

ADO.Net ADO.Net 
1 Comment(s)
 3045  View(s)
Rate this:
ADO.NET is also a part of the .NET Framework. ADO.NET is used to handle data access. With ADO.NET you can work with databases.

ADO.NET is a part of the .NET Framework
ADO.NET consists of a set of classes used to handle data access

Create a Database Connection

SqlConnection con = new SqlConnection(sqlString);


 SqlCommand cmd = new SqlCommand("select id, pass from student", con);SqlDataReader dr = cmd.ExecuteReader();

con.Close();use following namspaceusing System.Data;


using System.Data.SqlClient;

string sqlString = "Server=(local); Database=my; User Id=sa; Password=sa";


By Manish Sahu on   3 months ago

Keep sharing these types of articles.

Don't want to miss updates? Please click the below button!

Follow MindStick