Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Re: Stored procedure format in sqldataprovider file of my moduleRe: Stored procedure format in sqldataprovider file of my module
Previous
 
Next
New Post
3/5/2008 11:46 PM
 

Hi All,

       I have developed a module which has lot of search functions in it.For getting the search functionality workking i have written the stored procedure for example in the following way.

ex :

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE procedure dbo.XWD_CompetencyManager_Catogery_Search
@CatogerySearch nvarchar(50)

as

select CatogeryId,
          CreatedByUser,
          CreatedDate,
          CatogeryName,
          CatogeryDesc,
          ParentCatogeryId,
          SkillLevelTypeId

from  XWD_CompetencyManager_Catogery
where  CatogeryName like '%' + @CatogerySearch + '%'

 

GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

 

The above procedure when added to a sqldataprovider in the module package is throwing an error as below.

SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException: Incorrect syntax near '@CatogerySearch'. 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.XWD_CompetencyManager_Catogery_Search @CatogerySearch nvarchar(50) as select CatogeryId, CreatedByUser, CreatedDate, CatogeryName, CatogeryDesc, ParentCatogeryId, SkillLevelTypeId from XWD_CompetencyManager_Catogery where CatogeryName like '%' @CatogerySearch '%' System.Data.SqlClient.SqlException:

But when the same procedure is run in sql under host that is host-->sql it is running fine.But when i make a module pack and save this prcedure in the sqldataprovider file it is throwing an above error .

The same is being repeated with all the search procdures.Please help its urgent.

Thanks,

Sandeep.M

 

 
New Post
3/6/2008 8:14 AM
Accepted Answer 

Save your xx.xx.xxSQLDataProvider script files as UTF-8. Otherwise, the '+' characters will get removed. Although not related to the problem you are experiencing, your scripts should also be using {databaseOwner} instead of dbo. and {objectQualifier} as a prefix to any database object name. These will get replaced with the appropriate values from web.config when the module is installed.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Re: Stored procedure format in sqldataprovider file of my moduleRe: Stored procedure format in sqldataprovider file of my module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out