Data Provider provides objects through which functionalities like opening and closing connection, retrieving and updating data can be availed.
It also provides access to data source like SQL Server, Access, and Oracle).
Some of the data provider objects are:
ADO.NET provides access to all kind of data sources such as Microsoft SQL Server, OLEDB, Oracle, XML.
ADO.NET separates out the data access and data manipulation componenets. ADO.NET includes some providers from the .NET Framework to connect to the database, to execute commands, and finally to retrieve results. Those results are either directly used or can be put in dataset and manipulate it.
Data reader is based on the connected architecture for data access. Does not allow data manipulation
Dataset supports disconnected data access architecture. This gives better performance results.
Data reader is based on the connected architecture for data access. Does not allow data manipulation
Dataset supports disconnected data access architecture. This gives better performance results.
CommandType is a property of Command object which can be set to Text, Storedprocedure. If it is Text, the command executes the database query. When it is StoredProcedure, the command runs the stored procedure. A SqlCommand is an object that allows specifying what is to be performed in the database.
SqlConnection sqlCon = new SqlConnection(connectionString)
sqlCon.Open();
string strQuery = "select CategoryName from abcd";
SqlCommand cmd = new SqlCommand(strQuery, conn);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Console.WriteLine(reader [0]);
}
reader.Close();
con.Close();