PC Review


Reply
Thread Tools Rate Thread

DbProviderFactory - Problem or Not

 
 
=?Utf-8?B?VmxhZGljYSBPZ25qYW5vdmlj?=
Guest
Posts: n/a
 
      14th Dec 2005
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.

 
Reply With Quote
 
 
 
 
Sahil Malik [MVP C#]
Guest
Posts: n/a
 
      18th Dec 2005
Here's the answer -
http://blogs.msdn.com/sushilc/archiv...14/242395.aspx

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
__________________________________________________________

"Vladica Ognjanovic" <Vladica (E-Mail Removed)> wrote in
message news:9B27A15D-6987-449C-BEFD-(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
=?Utf-8?B?VmxhZGljYSBPZ25qYW5vdmlj?=
Guest
Posts: n/a
 
      21st Dec 2005
thanks

"Sahil Malik [MVP C#]" wrote:

> Here's the answer -
> http://blogs.msdn.com/sushilc/archiv...14/242395.aspx
>
> - Sahil Malik [MVP]
> ADO.NET 2.0 book -
> http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
> __________________________________________________________
>
> "Vladica Ognjanovic" <Vladica (E-Mail Removed)> wrote in
> message news:9B27A15D-6987-449C-BEFD-(E-Mail Removed)...
> > 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.
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DbProviderFactory Mihai Microsoft VB .NET 0 3rd Mar 2008 09:52 PM
Problem using DbProviderFactory with a Access 2000 database Gordon Microsoft ADO .NET 1 30th Jan 2008 04:00 PM
DbProviderFactory Rohit Microsoft ASP .NET 2 17th Oct 2007 06:17 PM
ADO.Net 2.0 - DbProviderFactory S Chapman Microsoft C# .NET 0 1st Jun 2006 11:51 AM
Re: DbProviderFactory and REF_CURSOR Sushil Chordia Microsoft ADO .NET 1 21st Mar 2005 10:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:04 AM.