|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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 *** 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
Resize problem (in IDE)
Broken References New bee:How do i make an .exe file in VS 2005? Windows Services works for years/months/weeks, then chokes Count lines in multi-line textbox DimeAttachment save to disk Using a Structure in a Class Can't Figure Out Correct Syntax Problems with Excel Object Library Zoom in Cephalometric system |
|||||||||||||||||||||||