G
Guest
First - English not so good.
I need a list of all database servers in my domain and I use code like
DataTable table = DbProviderFactories.GetFactoryClasses();
foreach (DataRow row in
DbProviderFactories.GetFactoryClasses().Rows)
{
DbProviderFactory providerFactory =
DbProviderFactories.GetFactory(row);
DbDataSourceEnumerator dsEnum =
providerFactory.CreateDataSourceEnumerator();
if (dsEnum != null)
{
servers = (DataTable)dsEnum.GetDataSources();
//this.dataGridView.DataSource = servers;
}
}
and I get a list of sqlClien and other. Problem is how do I connect to this
databases how do I build a connection string for each of them, because
generaly I dont know which databases I have in intanet.
Next question is how do I qet more datails about each database.
thanks.
I need a list of all database servers in my domain and I use code like
DataTable table = DbProviderFactories.GetFactoryClasses();
foreach (DataRow row in
DbProviderFactories.GetFactoryClasses().Rows)
{
DbProviderFactory providerFactory =
DbProviderFactories.GetFactory(row);
DbDataSourceEnumerator dsEnum =
providerFactory.CreateDataSourceEnumerator();
if (dsEnum != null)
{
servers = (DataTable)dsEnum.GetDataSources();
//this.dataGridView.DataSource = servers;
}
}
and I get a list of sqlClien and other. Problem is how do I connect to this
databases how do I build a connection string for each of them, because
generaly I dont know which databases I have in intanet.
Next question is how do I qet more datails about each database.
thanks.