?
Solved

VB.NET - Select network computer dialog box

Posted on 2011-03-04
5
Medium Priority
?
819 Views
Last Modified: 2012-08-14
Morning experts...

I am writing a small VB.NET forms application that will allow a user to input a server name, database name and credentials to connect to a database on the local network. Initially I was thinking that the FolderBrowserDialog would allow me to select a computer on the network. However I was mistaken! That only allows a user to select a folder within a computer on the network =)  All I want is the server name to put into the DB connection string.

Any suggestions would be greatly appreciated!!

Thanks!
0
Comment
Question by:romieb69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 16

Accepted Solution

by:
Kalpesh Chhatrala earned 1000 total points
ID: 35038690
0
 

Author Comment

by:romieb69
ID: 35038725
Read the question again. I'm not looking to select a network folder. I want to simply select the Network computer (the ok button does not light up using FolderBrowserDialog until you select an actual folder) ...
0
 
LVL 8

Expert Comment

by:Toxacon
ID: 35042215
If the computer running your software is in a Active Directory domain, you can make an LDAP query to the domain for computer objects and then filter out workstations.
0
 

Author Comment

by:romieb69
ID: 35071405
Thanks Toxacon ... yes that's absolutely correct. Found a good example on line on how to do that. What about in standard windows networks though where you would really only have the Network Neighborhood to use to allow a user to select a remote system... any ideas for that scenario?  

If not I'll just use what you suggested for now...

Thanks for the good suggestion!
0
 
LVL 3

Expert Comment

by:Avinash Desai
ID: 35221814
Hi

Just use the below code which retrives the installed SQL server Computers from the local network and then using the that you can form the connection string


CODE

    Dim dt As DataTable = Sql.SqlDataSourceEnumerator.Instance.GetDataSources
        For Each dr As DataRow In dt.Rows
            CbServer.Items.Add(String.Concat(dr("ServerName"), "\\", dr("InstanceName")))
        Next


If any doubt or problem in getting the info please let me know

Regards
Avinash Desai
   
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question