Skip to content

Instantly share code, notes, and snippets.

@fo40225
Created March 21, 2018 03:56
Show Gist options
  • Save fo40225/cb7f90f81a6fd50f15023ec8858cc165 to your computer and use it in GitHub Desktop.
Save fo40225/cb7f90f81a6fd50f15023ec8858cc165 to your computer and use it in GitHub Desktop.
detect oledb provider
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