Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

SmarterTools
Verndale
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  nvarchar data type supported?
Previous Previous
 
Next Next
New Post 9/10/2008 10:23 AM
Resolved
User is offline ClydeS
55 posts
10th Ranked


nvarchar data type supported? 

I am attempting to create a table using the SQL script generated by DotNetNuke Dynamic Module template.

I added the following column "[Subject] [nvarchar(4000)] NOT NULL" and got the following. 

System.Data.SqlClient.SqlException: Column, parameter, or variable #6: Cannot find data type nvarchar(4000). 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) /************************************************************/ /***** SqlDataProvider *****/ /***** *****/ /***** *****/ /***** Note: To manually execute this script you must *****/ /***** perform a search and replace operation *****/ /***** for dbo. and *****/ /***** *****/ /************************************************************/ /** Create Table **/ if not exists (select * from dbo.sysobjects where id = object_id(N'dbo.[DHW_AnonFeedback]') and OBJECTPROPERTY(id, N'IsTable') = 1) BEGIN CREATE TABLE dbo.[DHW_AnonFeedback] ( [ModuleID] [int] NOT NULL, [ItemID] [int] NOT NULL IDENTITY(1, 1), [Content] [ntext] NOT NULL, [CreatedByUser] [int] NOT NULL, [CreatedDate] [datetime] NOT NULL, [Subject] [nvarchar(4000)] NOT NULL ) ALTER TABLE dbo.[DHW_AnonFeedback] ADD CONSTRAINT [PK_DHW_AnonFeedback] PRIMARY KEY CLUSTERED ([ItemID]) CREATE NONCLUSTERED INDEX [IX_DHW_AnonFeedback] ON dbo.[DHW_AnonFeedback] ([ModuleID]) ALTER TABLE dbo.[DHW_AnonFeedback] WITH NOCHECK ADD CONSTRAINT [FK_DHW_AnonFeedback_Modules] FOREIGN KEY ([ModuleID]) REFERENCES dbo.[Modules] ([ModuleID]) ON DELETE CASCADE NOT FOR REPLICATION END System.Data.SqlClient.SqlException: Incorrect syntax near '@Subject'. 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 procedure dbo.DHW_AddAnonFeedback @ModuleId int, @Content ntext, @UserID int, @Subject nvarchar(4000) as insert into DHW_AnonFeedback ( ModuleId, Content, CreatedByUser, CreatedDate, Subject ) values ( @ModuleId, @Content, @UserID, getdate() @Subject )

Thanks for any help,


Clyde
 
New Post 9/10/2008 10:47 AM
User is offline Brian Dukes
476 posts
www.engagesoftware.com
8th Ranked


Re: nvarchar data type supported? 

It should be [nvarchar](4000) rather than [nvarchar(4000)].

Also, the second error in that script is that you're missing a comma after getdate().

Hope it helps,


Brian Dukes
Engage Software
St. Louis, MO
314.966.4000

The leading provider of DotNetNuke support, training and custom module development.
 
New Post 9/10/2008 12:11 PM
User is offline ClydeS
55 posts
10th Ranked


Re: nvarchar data type supported? 

Good eyes, all fixed up and going great.

Thanks much


Clyde
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  nvarchar data type supported?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DM Analytics, LLC
DM Analytics, LLC provides software solutions that facilitate rapid development of independent or dependent datamarts and their associated web-based reporting.
www.dmanalytics.com
Integral Hosting | DNN only $14.95/month
Experienced .NET hosting on Windows 2003, ASP.NET 1.1 & 2.0, MSSQL with real technical support.
www.integralhosting.com
Aricie
Aricie is one of the French pioneers and experts in DotNetNuke technology.
www.aricie.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP