Hi there!
I'm currently working on custom module development. I'm following an example from Building Websites with VB.NET and DotNetNuke.4 book. Everything is going alright until I run an example from Connecting to database chapter.
1. I select SQL from Host menu
2. Check run as script.
3. Copy the code from the book and paste it into the listbox
CREATE TABLE {databaseOwner}{objectQualifier} [EganEnterprises_CoffeeShopInfo] (
[coffeeShopID] [int] IDENTITY (1, 1) NOT NULL ,
[moduleID] [int] NOT NULL ,
[coffeeShopName] [varchar] (100) NOT NULL ,
[coffeeShopAddress1] [varchar] (150) NULL ,
[coffeeShopAddress2] [varchar] (150) NULL ,
[coffeeShopCity] [varchar] (50) NULL ,
[coffeeShopState] [char] (2) NULL ,
[coffeeShopZip] [char] (11) NULL ,
[coffeeShopWiFi] [smallint] NOT NULL ,
[coffeeShopDetails] [varchar] (250) NULL
) ON [PRIMARY]
GO
4. Click Execute and get this error message
System.Data.SqlClient.SqlException: Incorrect syntax near 'GO'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at DotNetNuke.Data.SqlDataProvider.ExecuteADOScript(String SQL) at DotNetNuke.Data.SqlDataProvider.ExecuteScript(String Script, Boolean UseTransactions) CREATE TABLE dbo. [EganEnterprises_CoffeeShopInfo] ( [coffeeShopID] [int] IDENTITY (1, 1) NOT NULL , [moduleID] [int] NOT NULL , [coffeeShopName] [varchar] (100) NOT NULL , [coffeeShopAddress1] [varchar] (150) NULL , [coffeeShopAddress2] [varchar] (150) NULL , [coffeeShopCity] [varchar] (50) NULL , [coffeeShopState] [char] (2) NULL , [coffeeShopZip] [char] (11) NULL , [coffeeShopWiFi] [smallint] NOT NULL , [coffeeShopDetails] [varchar] (250) NULL ) ON [PRIMARY] GO
I can't understand where the problem is. Please anyone let me know what the problem it could be.
Thank you