ALTER DATABASE test SET ENABLE_BROKER
this is the sql query i wish to execute while program is executing.. because i do not want to everytime i change computer also need open sql management tool to execute this query rath
ALTER DATABASE test SET ENABLE_BROKER
this is the sql query i wish to execute while program is executing.. because i do not want to everytime i change computer also need open sql management tool to execute this query rath
You can fire alter database
like a regular SQL statement:
Dim connection As SqlConnection
connection = New SqlConnection("Data Source=myServerAddress;" & _
"Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;")
Dim command As SqlCommand
command = connection.CreateCommand()
command.CommandText = "ALTER DATABASE test SET ENABLE_BROKER"
command.ExecuteNonQuery()
Better late than never. Missing opening and closing of the connection. In case anyone needs it:
Dim connection As SqlConnection
connection = New SqlConnection("Data Source=myServerAddress;" & _
"Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;")
connection.Open()
Dim command As SqlCommand
command = connection.CreateCommand()
command.CommandText = "ALTER DATABASE test SET ENABLE_BROKER"
command.ExecuteNonQuery()
connection.Close()