S
Simon Tamman {Uchiha Jax}
Here is the code:
SqlCommand nonQuery = myConnection.CreateCommand();
nonQuery.CommandText = command.Command;
result.Returned = nonQuery.ExecuteNonQuery(); /// exception occurs here
result.Success = true;
The command property of the command object (which is one of my custom
objects) is this:
USE Master
GO
CREATE DATABASE CynoNUnitTestDB
GO
USE CynoNUnitTestDB
GO
CREATE TABLE CynoUser........ (the rest is omitted for the sake of brevity)
I get the following exception:
Line 1: Incorrect syntax near 'GO'.
Line 1: Incorrect syntax near 'GO'.
Could not locate entry in sysdatabases for database 'CynoNUnitTestDB'. No
entry found with that name. Make sure that the name is entered correctly.
The connection string is this: Data Source=JAX;Initial
Catalog=Master;Integrated Security=SSPI;
Why is this a-ok with Query Analyzer but no good with the SqlCommand object?
Please assist.
Kind Regards
Jax
SqlCommand nonQuery = myConnection.CreateCommand();
nonQuery.CommandText = command.Command;
result.Returned = nonQuery.ExecuteNonQuery(); /// exception occurs here
result.Success = true;
The command property of the command object (which is one of my custom
objects) is this:
USE Master
GO
CREATE DATABASE CynoNUnitTestDB
GO
USE CynoNUnitTestDB
GO
CREATE TABLE CynoUser........ (the rest is omitted for the sake of brevity)
I get the following exception:
Line 1: Incorrect syntax near 'GO'.
Line 1: Incorrect syntax near 'GO'.
Could not locate entry in sysdatabases for database 'CynoNUnitTestDB'. No
entry found with that name. Make sure that the name is entered correctly.
The connection string is this: Data Source=JAX;Initial
Catalog=Master;Integrated Security=SSPI;
Why is this a-ok with Query Analyzer but no good with the SqlCommand object?
Please assist.
Kind Regards
Jax