The
System.Data.SqlClient
provider is the default .NET Framework Data Provider for
SQL Server
.
The
System.Data.OleDb
provider is the .NET Framework Data Provider for
OLE DB
.
The
System.Data.Odbc
provider is the .NET Framework Data Provider for
ODBC
.
The
System.Data.OracleClien
t provider is the .NET Framework Data Provider for
Oracle
.
source: SqlDataSource.ProviderName Property (System.Web.UI.WebControls)[
^]
You will have to specify at both the place ( Connection string and code )
Few Examples
SQL Server
using System.Data.SqlClient;
class Program
{
static void Main()
{
string sqlConnString = "Data Source=ServerName;Initial Catalog=DbName;Integrated Security=True";
SqlCommand objSQLCmd = new SqlCommand();
}
}
OLEDB
using System.Data.OleDb;
class Program
{
static void Main()
{
string oleConnString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='D://abc.xls'; Extended Properties= 'Excel 12.0;HDR=Yes;IMEX=1'";
OleDbCommand objOleDBExcelCmd = new OleDbCommand();
}
}