Thursday, March 29, 2012

enumerating registered sqlservers does not fill datatable complete

I've tried to enumerate sqlservers using two different methods and have the
same results... only the server name is returned, I am unable to get the
instance name so user will be unable to connect to selected server if it is
a
named instance (i.e. "Server"\SQLEXPRESS)...
Dim dt As DataTable
dt = SmoApplication.EnumAvailableSqlServers(False)
OR
Dim dt As DataTable
Dim instance As Sql.SqlDataSourceEnumerator =
Sql.SqlDataSourceEnumerator.Instance
dt = instance.GetDataSources
However I can go into SQL Server Management Studio, browse for servers and
every instance for every server (local and network) is listed... I assume
(foolishly) that MS Apps utilize thier own sdk's, if so why does it work
there but not for meOK I think I've found the culprit... the "Windows Firewall/Internet
Connection Sharing (ICS)" service
When I stop this service the enumerations return the Instance name and
Version of the SQL Servers... Hooray but what if Users have this service
running during my application installation? I'm suprised this isn't more of
a
known issue... I'm able to duplicate the issue on 2 machines both running XP
sp2 where one has SQL Server Express 2005 then other has SQL Server Express
2005 SP1, same results. Has anyone heard or exprienced this?

> I've tried to enumerate sqlservers using two different methods and have th
e
> same results... only the server name is returned, I am unable to get the
> instance name so user will be unable to connect to selected server if it i
s a
> named instance (i.e. "Server"\SQLEXPRESS)...
> Dim dt As DataTable
> dt = SmoApplication.EnumAvailableSqlServers(False)
> OR
> Dim dt As DataTable
> Dim instance As Sql.SqlDataSourceEnumerator =
> Sql.SqlDataSourceEnumerator.Instance
> dt = instance.GetDataSources
> However I can go into SQL Server Management Studio, browse for servers and
> every instance for every server (local and network) is listed... I assume
> (foolishly) that MS Apps utilize thier own sdk's, if so why does it work
> there but not for me|||On Tue, 13 Jun 2006 14:17:02 -0700, rqcoder
<rqcoder@.discussions.microsoft.com> wrote:
in <EF3759A0-3FE7-4839-B10E-E892752C02AB@.microsoft.com>

>OK I think I've found the culprit... the "Windows Firewall/Internet
>Connection Sharing (ICS)" service
>When I stop this service the enumerations return the Instance name and
>Version of the SQL Servers... Hooray but what if Users have this service
>running during my application installation? I'm suprised this isn't more of
a
>known issue... I'm able to duplicate the issue on 2 machines both running X
P
>sp2 where one has SQL Server Express 2005 then other has SQL Server Express
>2005 SP1, same results. Has anyone heard or exprienced this?
It happens on any machine that's running the firewall. It looks like
the tolerance window for the enumerations is extremely small - less than
a second. If anything hampers that initial query in the slightest then
the instance names don't show up. And I'm describing SQLDMO behavior
using VB6 but the enumerations code is most likely the same or extremely
similar.
What works well for me is Kerio Personal Firewall with specific rules
but that doesn't always wash well in the general user community.
Stefan Berglund

No comments:

Post a Comment