aplusexpert
asked on
SMO Error - Cannot Connect to Server
Hello Friends,
I have SQL Script File for Creating Whole database.
I want to execute that "Script" file from my c# application.So I used SMO Object for it. But some how it is giving me error that "could not connect to the server".
I have also tried SqlHelper.ExecuteNonQuery( ScriptText ). but throws error that
"Incorrect Systax near GO Statement"
Note that this same query is WORKING fine while executing direct from SQL SERVER. So, No Errors in Script File.
I am using SQL SERVER 2008 R2.
I also want to know the same logic will work in SQL SERVER 2005 ?
Please feel free to ask in case of any query
Thanks In Advance.
I have SQL Script File for Creating Whole database.
I want to execute that "Script" file from my c# application.So I used SMO Object for it. But some how it is giving me error that "could not connect to the server".
I have also tried SqlHelper.ExecuteNonQuery(
"Incorrect Systax near GO Statement"
Note that this same query is WORKING fine while executing direct from SQL SERVER. So, No Errors in Script File.
I am using SQL SERVER 2008 R2.
I also want to know the same logic will work in SQL SERVER 2005 ?
Please feel free to ask in case of any query
Thanks In Advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the actual value of ScriptText?
ASKER
Partial Solution. didn't really work in our case
ASKER
I have replace all "GO" Statement with ";". but Still i am getting the Same Error.