473,320 Members | 2,092 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Connection Properties Dialog Box?

Hi! I am creating a Windows app in VS2005 which will allow the user to
choose from different SQL data sources. I could hardcode a selection of
connection strings, but I'd rather not (in case a new database is
created, etc.). I'd like to use the common dialog box which appears
when you navigate to Project Properties > Settings

Select Type=(Connection String), then click in the cell in the Value
column. A Connection Properties dialog opens up. If anyone knows how
to programmatically access this dialog box, I'd really appreciate it!
I've been looking all over the place for it!!!

TIA,

DaveS

*** Sent via Developersdex http://www.developersdex.com ***
Feb 15 '06 #1
1 2672
jvb
I built something in VS2003 that uses SQLDMO to get a list of servers
and then once authenticated on that server, a list of the databases
that are on that server and tables in the database. I do not know if
there is anything built into VS that will give you access to that
dialog.

Make sure you have a reference to DMO in your project. Your network
security may also prevent this from working. This snipet below gets the
SQL servers on your network. If this works for you, i can post the rest
of the code, didnt want to clog up the thread if it isn't going to work
for you in VS2005!

Hope this helps or at least points you in a good direction!

Private Sub LoadSQLServers(Optional ByVal ObjToFill As Object =
Nothing)

Dim SQLDMO As New SQLDMO.Application
Dim List As SQLDMO.NameList
Dim SQLServerName As Object
Dim i As Integer
Dim SQLServers() As String

Try

List = SQLDMO.ListAvailableSQLServers
Catch ex As Exception
MsgBox(Err.Number & vbCrLf & vbCrLf & Err.Description &
vbCrLf & vbCrLf)

MsgBox("Unable to generate list of available SQL Servers."
& vbCrLf & "Check your network connections " & _
"try again.", MsgBoxStyle.Critical + MsgBoxStyle.OKOnly,
_
"SQL Server Location Error")
Exit Sub
End Try

ReDim SQLServers(List.Count)

'ObjToFill is assumed to be a list type control
ObjToFill.items.clear()

For Each SQLServerName In List : i += 1
SQLServers(i) = (List.Item(i))
If Not ObjToFill Is Nothing Then
ObjToFill.items.add(SQLServers(i))
End If
Next

End Sub

Feb 15 '06 #2

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

Similar topics

5
by: Fred Zuckerman | last post by:
Hello All, After reading in this group about the preference for connecting to a SQL Server using a connection string instead of a DSN file, I have done just that. BUT, I cannot update my data....
0
by: Jay Douglas | last post by:
Hello, I'm trying to create a Data Links Property window that behaves just like the dialog box in Visual Studio .Net for MS Sql Server connections. I've found a lot of examples that use...
0
by: Wysiwyg | last post by:
I'm writing an application in C# with Visual Studio 2003. I want to put a sql server connection dialog on a form used to configure an application. This is for setting up the connection and saving...
6
by: bryanhobson | last post by:
I'm fairly new to c#, and I am just trying to work out how a 'properties' dialog works. Currently in my code, I have an object represented by the class 'Dog'. The dog object has several...
1
by: James Goodman | last post by:
In VB6 I used to set my applications to automatically look for the source DB in the program installation directory. If it wasnt found it was fairly easy to pop a dialog asking the user to specify the...
7
by: Henry | last post by:
I am writing a Windows forms VB.Net/MS SQL application via VS 2003 that utilizes Crystal Reports. I want to be able to dynamically set the report data source at run time. I'm trying to change...
1
by: gdgass | last post by:
Hi, I'm in the process of developing an app to scan and archive photos based upon the EXIF/Photo Keyword property. One of the requirements is that the Photo's keywords be editable via Digital...
1
by: =?Utf-8?B?VGVlcmF2ZWU=?= | last post by:
I try to invoke Connection Properties dialog box that Visual Studio 2005 use. The dialog that I said is used in many places such as when developers build connection string in Settings.setting file...
1
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I want to provide user a connection dialog similar to or same as the Add Connection Dialog including Advanced Properties window.
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.