I want to know how to creat a database using a .sql script file i have.
I tryed this code:
SqlConnection cn = new SqlConnection();
cn.ConnectionString = "Data Source=(local);Initial Catalog=master;Integrated Security=True";
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandText = @"[LONG SCRIPT TEXT]";
But it gave me this error when reach the last line:
In Many Lines: Incorrect syntax near 'GO'
Could not locate entry in sysdatabases for database 'StoreBookKeeping'. No entry found with that name. Make sure that the name is entered correctly.
StoreBookKeeping is the name of the database i will creat.
Please help me.