5
Answers

Failed to connect to server SERVER.


Server server = new Server("SERVER");

server.ConnectionContext.SqlExecutionModes = 

SqlExecutionModes.CaptureSql;

Database db = server.Databases["myDatabase"];

This my code for connection for generate script but an error occur

(Failed to connect to server SERVER.) in this line

Database db = server.Databases["myDatabase"];



Answers (5)