Fatal Error with dates on Invite

rated by 0 users
This post has 2 Replies | 1 Follower

Not Ranked
Posts 3
Points 30
BigTones Posted: Mon, Mar 12 2007 9:47 PM

Hi,

 Just installed community server a week ago, and it was all working great up until today, the 13th of March 2007. We have configured the site to allow invites, but now when we try to send send out an invite, we get the 'Ooops Error'. We're in Western Australia so use +800 GMT and I turned on full errors in the web.config and got this SQL Server error below from the stack trace. The server is configured for dd-mm-yyyy so I don't know what varchar date Community Server is trying to send it, or how to fix it. I think the error is SQL server is interpreting the 13th as the month and causing an error, rather than interpreting it as the day. Any clues ?? Using the latest CS build.

Server Error in '/' Application.

Error converting data type nvarchar to datetime.

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.Data.SqlClient.SqlException: Error converting data type nvarchar to datetime.

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:

[SqlException (0x80131904): Error converting data type nvarchar to datetime.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857418
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735030
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +149
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +415
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +135
CommunityServer.Data.SqlCommonDataProvider.CreateUserInvitation(UserInvitation invite) +448
CommunityServer.UserInvitations.Create(UserInvitation invite) +40
CommunityServer.Controls.InviteUser.Send_Click(Object sender, EventArgs e) +285
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
 

 


 

Top 25 Contributor
Posts 948
Points 14,515
CS Developers

I fixed this error and it will be available with the next service pack, and it is already fixed in the 2007 beta release.

Since this is a quick fix I would recommend downloading the SDK and recompiling the SqlDataProvider project with the following fix. You can then copy over the updated assembly.

Once you have the SDK you should open the SqlCommonDataProvider.cs file and navigate to around line 2638, it reads as follows:

    myCommand.Parameters.Add("@DateInvited", SqlDbType.NVarChar, 2000).Value = invite.DateInvited;

You should change this to:

    myCommand.Parameters.Add("@DateInvited", SqlDbType.DateTime).Value = invite.DateInvited;

After you make the change you can save the file and recompile as outlined above.

 

Please let me know if you have any questions.

 

Thank you,

Wyatt Preul
Wyatt - The Geek Cowboy

  • | Post Points: 20
Not Ranked
Posts 3
Points 30
BigTones replied on Tue, Mar 13 2007 8:06 PM
Thanks Wyatt, that worked - your a champ !
  • | Post Points: 5
Page 1 of 1 (3 items) | RSS
Powered by Community Server (Commercial Edition), by Telligent Systems

Copyright© 2008 Telligent Systems Inc. All rights reserved
CommunityServer.com  •  Telligent.com