Solved

VB.NET - Select network computer dialog box

Posted on 2011-03-04
5
790 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MYSQL responding very slow 3 67
How to repeat the data 4 43
VB.Net  Exporting Excel Woorkbook to PDF 7 72
Broken .resx file generating errors 18 44
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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

734 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