Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • sperr0w 48 posts 81 karma points
    Aug 03, 2009 @ 07:37
    sperr0w
    0

    Commerce4Umbraco - Problem while creating Product

    Hi again!

    I also find this problem:

     

    In Commerce admin section I try to create a new product, for example "Test Poduct" (Products->Create) And I see create product window. I check Manufacturer and type in "Test Poduct" as Product Name and push create. After it I find error:

    Application server error '/'.

    DateTime conversion from symbol string error

    SubSonic.SqlQueryException: DateTime conversion from symbol string error (Ошибка преобразования datetime из символьной строки).

    Row 68: typeInstance.Alias = Text;
    Row 69: typeInstance.UserId = BasePages.UmbracoEnsuredPage.GetUserId(BasePages.UmbracoEnsuredPage.umbracoUserContextID);

    Row 70: typeInstance.Save();
    Row 71:
    Row 72: // check for returning url

    Source file: D:\UmIntegrator\umbraco 4.0.1 commerce\umbraco\presentation\umbraco\create\dialogHandler_temp.cs Row: 70

    Stack trace:

    [SqlQueryException: DateTime conversion from symbol string error.]
    SubSonic.Insert.Execute() +293
    CommerceForUmbraco.adminSection.tasks.ProductTasks.InsertProduct() +1990
    CommerceForUmbraco.adminSection.tasks.ProductTasks.Save() +44
    umbraco.presentation.create.dialogHandlertemp.Create(String NodeType, Int32 TypeId, Int32 NodeId, String Text) in D:\UmIntegrator\umbraco 4.0.1 commerce\umbraco\presentation\umbraco\create\dialogHandlertemp.cs:70
    CommerceForUmbraco.adminSection.commerce.CreateProduct.sbmt_Click(Object sender, EventArgs e) +168
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565


    When I create more detalied debug, i find, that error comes from CommerceTasks.cs file of CommerceForUmbraco.adminSection project:

    int successOrNot = new SubSonic.Insert().Into(Product.Schema).Values(
    Alias
    ,System.Guid.NewGuid().ToString()
    ,Alias
    ,Alias
    ,manufacturerId
    ,DBNull.Value
    ,1
    ,1
    ,1
    ,1
    ,1
    ,DBNull.Value
    ,0
    ,0
    ,0
    ,SiteConfig.CurrencyCode.ToString()
    ,"each"
    ,DBNull.Value
    ,0
    ,0
    ,0
    ,"each"
    ,0
    ,99
    ,4
    ,1
    ,DBNull.Value
    ,SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true)
    ,"Commerce For Umbraco"
    , SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true)
    , "Commerce For Umbraco")
    .Execute(); - SqlQueryException



    What I need to eliminate this error to add new products using admin section UI

    Also I find: if I delete SubSonic.Utilities.Utility.FormatDate from function (type in only DateTime.Now) then recompile commerce project and update libraries, all work. What u can say about this decision of this problem?

    int successOrNot = new SubSonic.Insert().Into(Product.Schema).Values(
    Alias
    ,System.Guid.NewGuid().ToString()
    ,Alias
    ,Alias
    ,manufacturerId
    ,DBNull.Value
    ,1
    ,1
    ,1
    ,1
    ,1
    ,DBNull.Value
    ,0
    ,0
    ,0
    ,SiteConfig.CurrencyCode.ToString()
    ,"each"
    ,DBNull.Value
    ,0
    ,0
    ,0
    ,"each"
    ,0
    ,99
    ,4
    ,1
    ,DBNull.Value
    ,DateTime.Now, true
    ,"Commerce For Umbraco"
    , DateTime.Now, true
    , "Commerce For Umbraco")
    .Execute(); - SqlQueryException

  • Paul Sterling 718 posts 1534 karma points MVP 9x admin c-trib
    Aug 03, 2009 @ 19:16
    Paul Sterling
    0

    Hi -

    Pretty sure you're running into an issue with SubSonic date formatting:

    SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true)

    As it seems you've already found.  It appears that SubSonic does not support the culture you have set (which is it?).  I'd recommend looking at the SubSonic forums which are hosted at http://www.StackOverflow.com

    -Paul

  • sperr0w 48 posts 81 karma points
    Aug 04, 2009 @ 04:45
    sperr0w
    0

    Thanks for your reply, Paul. I also think, that my error connected to culture ( I use Russian Windows XP) and FormatDate function, but what if I use DateTime.Now instead

    SubSonic.Utilities.Utility.FormatDate(DateTime.Now, true)

    What Problems can comes?

    
    
                
  • Paul Sterling 718 posts 1534 karma points MVP 9x admin c-trib
    Aug 05, 2009 @ 20:48
    Paul Sterling
    100

    I'm not clear what the question is?  In any case I'd recommend not using the SubSonic FormatDate function as your cluture does not appear to be supported.

    -Paul

  • sperr0w 48 posts 81 karma points
    Aug 06, 2009 @ 05:24
    sperr0w
    0

    Thanks, I ask exactly about it.

  • sperr0w 48 posts 81 karma points
    Aug 06, 2009 @ 05:33
    sperr0w
    0

    Paul, can u tell me something about my thread about deleting actions in Commerce admn section?

    http://our.umbraco.org/forum/getting-started/questions-about-runway-and-modules/3311-Commerce4Umbraco---Error-while-deleting-product

Please Sign in or register to post replies

Write your reply to:

Draft