JeremyThake
-
2/21/2006 7:33:29 AM
CMSForm
I'm getting this error
"Column 'COM_ProductName' does not belong to table Table1. "
when I try to add a new item of CMS type 'Product'.
I've tweaked the query.config file to allow the select and selectByPath to have access to the joined COM_Product table. I'm using the cmsdatalist using two transformations that both use CONTENT_Product and COM_Product information.
What do I have to do to get round this? Something the CMSForm object is doing is preventing it from adding a product and for some reason is searching for COM_ProductName on inserting it!
<queries> <query id="select" type="querytext" transaction="false">SELECT *, dbo.COM_Product.ProductName AS COM_ProductName FROM view_cms_tree_joined INNER JOIN [CONTENT_Product] ON [CONTENT_Product].[ProductID] = view_cms_tree_joined.foreignkeyvalue INNER JOIN dbo.COM_Product ON dbo.COM_Product.ProductID = view_cms_tree_joined.comproductid WHERE classname = 'CMS.Product' AND CONTENT_Product.productID = @ID </query> <query id="insert" transaction="true" type="query">INSERT INTO [CONTENT_Product] ( [ProductDescription], [ProductPhoto], [FeaturedProduct] , ShippingPrice_AUS, ShippingPrice_PACIFIC, ShippingPrice_OVERSEAS, ProductPrice_Member, ProductPrice_NonMember) VALUES ( @ProductDescription, @ProductPhoto, @FeaturedProduct, @ShippingPrice_AUS, @ShippingPrice_PACIFIC, @ShippingPrice_OVERSEAS, @ProductPrice_Member, @ProductPrice_NonMember); SELECT @@identity AS [ProductID] </query> <query id="update" type="query" transaction="false">UPDATE [CONTENT_Product] SET [ProductDescription] = @ProductDescription, [ProductPhoto] = @ProductPhoto, [FeaturedProduct] = @FeaturedProduct, ShippingPrice_AUS = @ShippingPrice_AUS, ShippingPrice_PACIFIC = @ShippingPrice_PACIFIC, ShippingPrice_OVERSEAS = @ShippingPrice_OVERSEAS, ProductPrice_Member = @ProductPrice_Member, ProductPrice_NonMember = @ProductPrice_NonMember WHERE [ProductID] = @ProductID</query> <query id="delete" type="query" transaction="false">DELETE FROM [CONTENT_Product] WHERE [ProductID] = @ID</query> <query id="selectbypath" type="querytext" transaction="false">SELECT view_cms_tree_joined.*, [CONTENT_Product].* , dbo.COM_Product.ProductName AS COM_ProductName , dbo.COM_Product.ProductPrice AS COM_ProductPrice FROM view_cms_tree_joined INNER JOIN [CONTENT_Product] ON [CONTENT_Product].[ProductID] = view_cms_tree_joined.foreignkeyvalue INNER JOIN dbo.COM_Product ON dbo.COM_Product.ProductID = view_cms_tree_joined.comproductid WHERE (##WHERE##) AND classname = 'CMS.Product' ORDER BY ##ORDERBY## </query> <query id="searchtree" type="query" transaction="false">SELECT view_cms_tree_joined.*, view_cms_tree_joined.NodeName AS SearchResultName FROM view_cms_tree_joined INNER JOIN [CONTENT_Product] ON [CONTENT_Product].[ProductID] = view_cms_tree_joined.foreignkeyvalue WHERE IDPath LIKE @IDPath AND classname = 'CMS.Product' AND ( [ProductName] Like N'%'+ @Expression + N'%' OR [ProductDescription] Like N'%'+ @Expression + N'%' OR [ProductPhoto] Like N'%'+ @Expression + N'%' ) </query> <query id="featured" type="querytext" transaction="false">SELECT top 1 *, dbo.COM_Product.ProductName AS COM_ProductName FROM view_cms_tree_joined INNER JOIN Content_Product ON content_product.ProductID = view_cms_tree_joined.foreignkeyvalue INNER JOIN dbo.COM_Product ON dbo.COM_Product.ProductID = view_cms_tree_joined.comproductid WHERE classname = 'cms.product' AND FeaturedProduct = 1 AND Published = 1 </query> </queries>
Server Error in '/BibTrackKenticoCMS' Application. --------------------------------------------------------------------------------
Column 'COM_ProductName' does not belong to table Table1. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Column 'COM_ProductName' does not belong to table Table1.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentException: Column 'COM_ProductName' does not belong to table Table1.] System.Data.DataRow.get_Item(String columnName) +121 Kentico.CMS.TreeEngine.TreeNode.GetValue(String columnName) Kentico.CMS.Form.CMSForm.SaveDataToDB() Kentico.CMS.Form.BasicForm.SaveData(String redirectUrlAfterSave) Kentico.CMS.Form.BasicForm.SaveDataClick(Object sender, EventArgs e) System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain() +1277
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
|