problem with downloadable products

Feb 15, 2010 at 3:20 PM

Hi

I keep getting an error when I add the following token values for downloadable products:

[TAG:DOCPURCHASEDLINK1]

[TAG:DOCPURCHASED1]

Error text:

DotNetNuke.Services.Exceptions.ModuleLoadException: Invalid object name 'NB_Store_Orders'. ---> System.Data.SqlClient.SqlException: Invalid object name 'NB_Store_Orders'. 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.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, String spName, Object[] parameterValues) at NEvoWeb.Modules.NB_Store.SqlDataProvider.CheckIfProductPurchased(Int32 ProductID, Int32 UserID) at NEvoWeb.Modules.NB_Store.SharedFunctions.DocHasBeenPurchased(Int32 UserID, Int32 ProductID) at NEvoWeb.Modules.NB_Store.ProductTemplate.DocLink_DataBinding(Object sender, EventArgs e) at System.Web.UI.Control.OnDataBinding(EventArgs e) at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.Control.DataBindChildren() at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.WebControls.DataList.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) at System.Web.UI.WebControls.DataList.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.BaseDataList.DataBind() at NEvoWeb.Modules.NB_Store.ProductList.populateSP(Int32 ProdID) at NEvoWeb.Modules.NB_Store.ProductList.Page_Init(Object sender, EventArgs e) --- End of inner exception stack trace ---

I am only seeing this error when I add the above tokens to the product detail - I have no errors if I use [TAG:DOC1]

I installed DNN with an object qualifier of DNN_ so I think that this may be causing the problen  but I'm not sure how to correct this.

I would really appreciate your help with this.

Thank you

Lucy

Feb 15, 2010 at 9:33 PM

Hi Lucy,

yes, you've found a bug in the SQL scripts.. below I've listed what you need to run in the Host>SQL option of DNN.  Don;t forget to tick the "run as script" checkbox, when you run this..

--------------------------------------------------------------------------------------------

CREATE     PROCEDURE {databaseOwner}[{objectQualifier}NEvoweb_NB_Store_Products_CheckPurchased]
@ProductID int,
@UserID int
AS
begin

select Count(O.OrderID)
from {databaseOwner}{objectQualifier}NB_Store_Orders as O
inner join {databaseOwner}{objectQualifier}NB_Store_OrderDetails as OD on OD.OrderID = O.OrderID
inner join {databaseOwner}{objectQualifier}NB_Store_Model as M on M.ModelID = OD.ModelID
where userid = @UserID
and (O.OrderStatusID = 40 or O.OrderStatusID =  70)
and ProductID = @ProductID
 
end

-----------------------------------------------------------------------------------------------------

I'm not in the office until next week, so I can;t test this until then, so please let me know if this fixes the problem.

Regards,

Dave.

Feb 15, 2010 at 9:33 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 16, 2010 at 9:16 AM

Hi Dave

Brilliant that worked perfectly :-)

Thank you so much.

lucy