473,654 Members | 3,239 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NetServerEnum

Hi All,

I'm not sure if this is the right or best place to post this question, but
as the problem is within a VB.NET app, I'll give it a go:

I am populating a combobox with a list of SQL servers on a network using
NetServerEnum. The Server Type is set to 4 (which is for SQL Servers). When
the user selects a server from the combobox, another combobox is populated
with the available databases on that server. I know there are three SQL
servers on the network, but only 2 are showing up in the list. But, if I
type the missing server name into the textbox portion of the combobox, the
list of DBs available on that server appears in the DB combobox. So, it's
not a connectivity issue.

All three SQL Servers are WINXP (SP2) with MSDE 2000.

Any ideas why one of them is not showing up?

TIA
Lee
Nov 21 '05 #1
3 2633
Hi Lee,

Welcome to MSDN newsgroup.
As for the one server not display when using NetServerEnum to search all
the existing SQLServers in the network you mentioend, I'm thinking whether
it is a machine specific problem. Does the problem also occur if you try
the same code on some other machine in the network? Also, is there anything
obviously different on that missing server from the other two servers?

In addition, based on my research we can also use SQLDMO component to query
all the existing sqlservers. You can have a look at the SQLdmo code in the
following threads and test to see wheher it can retrieve the complete list
or get the same result with the NetServerEnum:

http://www.dotnet247.com/247referenc...31/155355.aspx

If there're any other findings, please also feel free to post here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)





Nov 21 '05 #2
thanks for the reply Steven,

Interesting, I loaded the app onto the machine that wasn't showing up in the
list. Even running the app from that machine, the other two servers show up,
but it doesn't! So, I'm stuck. It's obviously not a conectivity issue, since
I can still connect to the DB from the other machines, and I can connect to
the other servers from the "Missing" machine.

I suspect that a quick uninstall/re-install of MSDE on that machine will fix
it, though there's probably an easier way to fix it. Where and how does the
OS actually make available it's ServerType? A registry entry?

TIA
Lee

"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:%2******** *********@TK2MS FTNGXA01.phx.gb l...
Hi Lee,

Welcome to MSDN newsgroup.
As for the one server not display when using NetServerEnum to search all
the existing SQLServers in the network you mentioend, I'm thinking whether
it is a machine specific problem. Does the problem also occur if you try
the same code on some other machine in the network? Also, is there
anything
obviously different on that missing server from the other two servers?

In addition, based on my research we can also use SQLDMO component to
query
all the existing sqlservers. You can have a look at the SQLdmo code in the
following threads and test to see wheher it can retrieve the complete list
or get the same result with the NetServerEnum:

http://www.dotnet247.com/247referenc...31/155355.aspx

If there're any other findings, please also feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)





Nov 21 '05 #3
Well, I found the problem, quite by accident or by luck. The ntwdblib.dll
was missing from the Windows/system32 dir. Copied it from another machine,
rebooted, now the machine shows up in the app!

thanks for pointing me to a machine specific problem!

cheers
Lee
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:%2******** *********@TK2MS FTNGXA01.phx.gb l...
Hi Lee,

Welcome to MSDN newsgroup.
As for the one server not display when using NetServerEnum to search all
the existing SQLServers in the network you mentioend, I'm thinking whether
it is a machine specific problem. Does the problem also occur if you try
the same code on some other machine in the network? Also, is there
anything
obviously different on that missing server from the other two servers?

In addition, based on my research we can also use SQLDMO component to
query
all the existing sqlservers. You can have a look at the SQLdmo code in the
following threads and test to see wheher it can retrieve the complete list
or get the same result with the NetServerEnum:

http://www.dotnet247.com/247referenc...31/155355.aspx

If there're any other findings, please also feel free to post here.
Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)





Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2665
by: Dmitry | last post by:
Hi. I'm interesting how to enumerate available SQL servers in the network from code in C#. It may be done in C++ using WINAPI function NetServerEnum. If there is no way except importing this function from DLL, help to write C# declarations please. Thanks.
7
9069
by: trint | last post by:
How can I add all the network printers to a combobox? Thanks, Trint
1
9836
by: Dave Thorn | last post by:
Im trying to write an application which goes through selected servers on the network and (according to the file path provided) recurses through all folders and deletes log files that fit a specified criteria. This is working when passing UNC names between the methods, but the users need to know the UNC path if the server isnt in the list currently held by the app. What the users need is the equivalent of the FolderBrowserDialog that...
5
9812
by: Robin Tucker | last post by:
I need to marshal an IntPtr (which I've got from GlobalLock of an HGLOBAL) into a byte array. I know the size of the array required and I've got a pointer to the blob, but I can't see how to copy the memory across. Using Marshal.PtrStructure doesn't work - it says my byte() array is not blittable! (byte is a blittable type however). Cannot use Marshal.Copy, because that works the other way around (for mashalling to COM, not from it). ...
1
4123
by: Terry Olsen | last post by:
I am trying to convert a program I wrote in VB6 that gathered all the names of servers on the network and put them in a list box. VB .NET does not allow a typecast of "Any". I am having big troubles figuring out how to correctly call this API function in VB .NET. Any help, or even an example would be greatly appreciated. Thanks!
3
3871
by: Steve | last post by:
Hi all How would i get a list of all Active Computers on a network? All I need are the computer names. Kind Regards, Steve.
3
1335
by: JD | last post by:
I'm looking for a simple way to get a list of my server off of the network. Primarily I'm looking for my SQLServers. In VB6 I'd use SQLDMO, but I was looking for a pure .net solution. Anything?????
3
2768
by: Joe User | last post by:
Hi - I found the class below on another website (www.devx.com) and can't seem to figure out how to make a call to this class to retrieve the machines and put them in a listbox. I am definitely a beginner in vb programming, and would really appreciate the help. TIA!
2
2069
by: j-in-uk | last post by:
I am using NetServerEnum to get a list of sqlserver databases in my c# code. I notice it does not return sqlexpress databases. What can I use to get a list of all sqlservers? Thanks
0
8379
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8294
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8709
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8494
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7309
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2719
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1597
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.