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.