If you use System.Data.SqlClient.SqlConnection (directly or indirectly), there is no need to specify the Provider element in the connection string. I assume that this value is simply ignored, if provided.
See the documentation for a complete list of all supported items in the SqlConnection connection strings.
However, if you use OleDb, this does what you want: http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbenumerator.aspx
For instance:
internal static class Program { private static void Main(string[] args) { using (OleDbDataReader dataReader = OleDbEnumerator.GetRootEnumerator()) { while (dataReader.Read()) { Console.WriteLine("{0}, {1}", dataReader[0], dataReader[2]); } } } }
source share