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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesmy {0objectqualifier} parameters do not workmy {0objectqualifier} parameters do not work
Previous
 
Next
New Post
5/5/2011 2:35 AM
 
I have a data provider that creates a table, inserts into it, selects from it and counts it.  The code to create table works but the others get an error on {objectqualifier}.  Invalid object name 'dbo.{objectqualifier}

Here is my data provider code.  Any help would be greatly appreciated.

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[{objectQualifier}usercomments](
 [moduleid] [int] null,
 [comment] [text] NULL,
 [date] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

---------------------------------
create procedure [dbo].[sp_viewcomments]

@moduleid int
 
AS

BEGIN
SET NOCOUNT ON
 SELECT moduleid, comment, date from [{objectqualifier}usercomments] where moduleid=@moduleid
end
go

------------------------------
create PROCEDURE [dbo].[sp_usercommentsinsert]
  
@moduleid int,
@comment text,
@commentdate datetime

AS
BEGIN
SET NOCOUNT ON;
 insert into [dbo].[{objectqualifier}usercomments] (moduleid, comment, date) values (@moduleid, @comment, @commentdate) 
END
go
-- =============================================
create PROCEDURE [dbo].[sp_countcomments]

@moduleid int
As
begin
 SELECT count(*) from [dbo].[{objectqualifier}usercomments] where moduleid=@moduleid
end
go





 
New Post
5/5/2011 4:04 AM
Accepted Answer 
Jelena

DataBase Owner and Object Qulifier are case sensitive and should be like this {databaseOwner}{objectQualifier}. In your script you have it in lowercase.

Sergey
 
New Post
5/5/2011 8:50 AM
 
Thanks Sergey.  The scripts did work for objectQualifier once I changed it as you suggested to match the proper case.  However, when I use {databaseOwner} I get a different error on the install.  It does work however with the hardcoded [dbo].  Here is the installation report.  Bellow are my dataproviders. 
----------------
Package Installation Report

See below for the results of the package installation
Error loading files from temporary folder - see below
StartJob Starting Installation
Info Starting Installation - UserComments
Info Starting Installation - Script
Info Begin Sql execution
Info Creating backup of previous version - 05.02.05.SqlDataProvider
Info Created - 05.02.05.SqlDataProvider
Info Executing 05.02.05.SqlDataProvider
Info Start Sql execution: 05.02.05.SqlDataProvider file
Failure SQL Execution resulted in following Exceptions: System.Data.SqlClient.SqlException (0x80131904): The specified schema name "dbo." either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() 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.].[dnn_usercomments]( [moduleid] [int] null, [comment] [text] NULL, [date] [datetime] NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] System.Data.SqlClient.SqlException (0x80131904): The specified schema name "dbo." either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() 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.].[sp_viewcomments] @moduleid int AS BEGIN SET NOCOUNT ON SELECT moduleid, comment, date from [dnn_usercomments] where moduleid=@moduleid end System.Data.SqlClient.SqlException (0x80131904): The specified schema name "dbo." either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() 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.].[sp_usercommentsinsert] @moduleid int, @comment text, @commentdate datetime AS BEGIN SET NOCOUNT ON; insert into [dbo.].[dnn_usercomments] (moduleid, comment, date) values (@moduleid, @comment, @commentdate) END System.Data.SqlClient.SqlException (0x80131904): The specified schema name "dbo." either does not exist or you do not have permission to use it. at System.Data.SqlClient.SqlConnection. (SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() 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.].[sp_countcomments] @moduleid int As begin SELECT count(*) from [dbo.].[dnn_usercomments] where moduleid=@moduleid end
Info End Sql execution: 05.02.05.SqlDataProvider file
Info Finished Sql execution
Failure Installation Failed - Script
Info Installation Failed - UserComments
Info Deleted temporary install folder
EndJob Installation Failed
dataproviders:

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [{databaseOwner}].[{objectQualifier}usercomments](
 [moduleid] [int] null,
 [comment] [text] NULL,
 [date] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

---------------------------------
create procedure [{databaseOwner}].[sp_viewcomments]

@moduleid int
 
AS

BEGIN
SET NOCOUNT ON
 SELECT moduleid, comment, date from [{objectQualifier}usercomments] where moduleid=@moduleid
end
go

------------------------------
create PROCEDURE [{databaseOwner}].[sp_usercommentsinsert]
  
@moduleid int,
@comment text,
@commentdate datetime

AS
BEGIN
SET NOCOUNT ON;
 insert into [{databaseOwner}].[{objectQualifier}usercomments] (moduleid, comment, date) values (@moduleid, @comment, @commentdate) 
END
go
-- =============================================
create PROCEDURE [{databaseOwner}].[sp_countcomments]

@moduleid int
As
begin
 SELECT count(*) from [{databaseOwner}].[{objectQualifier}usercomments] where moduleid=@moduleid
end
go


DROP TABLE
 [{databaseOwner}].[{objectQualifier}usercomments]
GO

drop procedure [{databaseOwner}].[sp_usercommentsinsert]
go
GO

drop procedure [{databaseOwner}].[sp_viewcomments]
go
GO

drop procedure [{databaseOwner}].[sp_countcomments]
go

 
New Post
5/5/2011 9:00 AM
 
Jelena

You should not use brackets [ and ]. Just use it lke this 


{databaseOwner}{objectQualifier}usercomments


No dots or speaces inside. DNN will do this job instead you 

Sergey
 
New Post
5/5/2011 9:05 AM
 
Jelena

To prevent errors in future, you can go to the Host/SQL and to try your query there. It shows if any errors in your query.

Sergey
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesmy {0objectqualifier} parameters do not workmy {0objectqualifier} parameters do not work


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