Solved

VB.NET - Select network computer dialog box

Posted on 2011-03-04
5
759 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
5 Comments
 
LVL 16

Accepted Solution

by:
Kalpesh Chhatrala earned 250 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now