Created
March 21, 2018 03:56
-
-
Save fo40225/cb7f90f81a6fd50f15023ec8858cc165 to your computer and use it in GitHub Desktop.
detect oledb provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var reader = OleDbEnumerator.GetRootEnumerator()) | |
{ | |
var colIndex = 0; | |
for (int i = 0; i < reader.FieldCount; i++) | |
{ | |
if (reader.GetName(i) == "SOURCES_NAME") | |
{ | |
colIndex = i; | |
} | |
} | |
while (reader.Read()) | |
{ | |
Console.WriteLine(reader.GetValue(colIndex)); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment