Hi,
Use the sp_databases stored procedure to list database names.
Dim strConn As String
Dim conn As SqlConnection
Dim cmd As SqlCommand
Dim dr As SqlDataReader
strConn = "Server =(local);"
strConn &= "Database = ; Integrated Security = SSPI;"
conn = New SqlConnection(strConn)
cmd = New SqlCommand("sp_Databases", conn)
cmd.CommandType = CommandType.StoredProcedure
conn.Open()
dr = cmd.ExecuteReader
If dr.HasRows Then
Do While dr.Read
Trace.WriteLine(String.Format("Name {0} Size {1}", _
dr.Item("Database_Name"), dr.Item("Database_Size")))
Loop
End If
dr.Close()
conn.Close()
Ken
----------------------
"Joăo Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:OW**************@TK2MSFTNGP09.phx.gbl...
i just want the get databases listname
thks
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,
What are you trying to do with sqldmo?
Ken
-----------------
"Joăo Santa Bárbara" <jo****@i24portugal.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...
Hi all
i need to know if sql dmo can connect to SQL server 2005
if can! how can i do this ??
i have this code
Dim xServer a SQLDMO.Server
.....bla..bla...
xServer.LoginSecure = True
xServer.Connect("SQLServer2005")
but it can´t connect.
is there anyother way ??
thks
JSB