Copied to clipboard

Flag this post as spam?

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


  • kukuwka 75 posts 96 karma points
    Nov 20, 2012 @ 11:39
    kukuwka
    0

    Conversion failed when converting date and/or time from character string.

    Hi,

    I created custom data type using TreePicker.This is my code:

     public object value
            {
                get
                {
                    //put the node in umbraco
                    bindXML(PickedBanners.Value);
                    return PickedBanners.Value.ToString();
                }
                set
                {
                    //get from umbraco
                    PickedBanners.Value = value.ToString();
                    bindXML(value.ToString());
                }
            }

    PickedBanners.Value returns  '<selectedNodes><selectedNode id="1108" /></selectedNodes>'

    But every time that I publish the node,I get the next error:

    [SqlException (0x80131904): Conversion failed when converting date and/or time from character string.]
       System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1742110
       System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5279619
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +242
       System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1434
       System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +269
       System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite) +1355
       System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +175
       System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +205
       System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +160
       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) +56
       Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) +78
       umbraco.DataLayer.SqlHelpers.SqlServer.SqlServerHelper.ExecuteNonQuery(String commandText, SqlParameter[] parameters) +18
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +79
    
    [SqlHelperException: Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery]
       umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters) +134
       umbraco.cms.businesslogic.datatype.DefaultData.set_Value(Object value) +732
       umbraco.editorControls.userControlGrapper.usercontrolDataEditor.Save() +60
       umbraco.controls.ContentControl.saveClick(Object Sender, ImageClickEventArgs e) +149
       umbraco.controls.ContentControl.savePublish(Object Sender, ImageClickEventArgs e) +20
       System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
       System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +124
       System.Web.UI.WebControls.ImageButton.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) +35
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

    What could be the reason?

    Thanks

     

Please Sign in or register to post replies

Write your reply to:

Draft