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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
i just want the get databases listname
thks
"Ken Tucker [MVP]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
>
> What are you trying to do with sqldmo?
>
> Ken
> -----------------
> "Joăo Santa Bárbara" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> 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
>
>
>
|