Hi, I’ve just downloaded dhtmlxConnector_net.zip and build the sample linked to MsSql 2005 DB: when I load the scheduler page in the sample I have this error:
“The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.”
The fields FromDate and ToDate are both datetime type.
The stange things is that CRUD operations are all ok, I can insert, update and delete a record in my DB, but I can’t render it on the scheduler!
The db collation is Latin1_General_CI_AS and the language is English (US).
I’m using Visual Studio 2010 on Windows7 in Italian language.
What can I try to do?
Thanks in advance for support.
Regards
Mauro
Can you enable logging in connector, and provide the log output for the problematic operation ?
Hi,
I’ve added Error Handling and Logging code but it doesn’t function… this is the .ashx page code:
Imports System
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.Services
Imports System.Configuration
Imports dhtmlxConnectors
Imports System.Diagnostics
Imports System.IO
‘’’
‘’’ Connector body
‘’’
<WebService([Namespace]:=“http://tempuri.org/ ”)> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class schedulerConnector
Inherits dhtmlxRequestHandler
Public Overrides Function CreateConnector(ByVal context As HttpContext) As IdhtmlxConnector
Dim connector As dhtmlxSchedulerConnector
connector = New dhtmlxSchedulerConnector("Events", _
"EventID", _
dhtmlxDatabaseAdapterType.SqlServer2005, _
ConfigurationManager.ConnectionStrings("SamplesDatabase").ConnectionString, _
"FromDate", "ToDate", _
"Subject as text, Details as details, Tags")
'AddHandler connector.ItemPrerender, AddressOf connector_ItemPrerender
AddHandler connector.Begin, AddressOf connector_Begin
AddHandler connector.End, AddressOf connector_End
AddHandler connector.ItemPrerender, AddressOf connector_Begin
Return connector
End Function
Private Sub connector_ItemPrerender(ByVal sender As Object, ByVal e As ItemPrerenderEventArgs(Of dhtmlxSchedulerDataItem))
'e.DataItem.DataFields("FromDate") = Now
'e.DataItem.DataFields("ToDate") = Now
End Sub
'we will store log content here
Private _LogContent As New StringBuilder()
Private Sub connector_End(ByVal sender As Object, ByVal e As EventArgs)
Log.Enabled = False
'stop logging
End Sub
Private Sub connector_Begin(ByVal sender As Object, ByVal e As EventArgs)
'enable logging and add listener to it
Log.Enabled = True
Log.Listeners.Add(New TextWriterTraceListener(New StringWriter(Me._LogContent)))
Dim objStream As FileStream = New FileStream("C:\\AppLog.txt", FileMode.OpenOrCreate)
Dim objTraceListener As TextWriterTraceListener = New TextWriterTraceListener(objStream)
Trace.Listeners.Add(objTraceListener)
Trace.WriteLine("Hello This is first trace")
Trace.WriteLine("Hello again -- This is second trace message")
Debug.WriteLine("Hello again -- This is first debug message")
Trace.Flush()
objStream.Close()
End Sub
End Class
In the windows event viewer I found this error message:
in System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) in System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) in System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) in System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) in System.Data.SqlClient.SqlDataReader.HasMoreRows() in System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) in System.Data.SqlClient.SqlDataReader.Read() in System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) in System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) in System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) in System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) in System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) in System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) in dhtmlxConnectors.MSSQLAdapter.ExecuteSelectQuery(String Query) in dhtmlxConnectors.MSSQLAdapter.ExecuteSelectQuery(String TableName, IEnumerable1 RequestedFields, List1 Rules, List1 OrderBy, Int32 StartIndex, Int32 Count) in dhtmlxConnectors.DataRequest.Render(XmlWriter xWriter) in dhtmlxConnectors.dhtmlxConnector1.Render(XmlWriter xWriter) in dhtmlxConnectors.dhtmlxConnector`1.RenderResponse(HttpResponse response) in dhtmlxConnectors.dhtmlxRequestHandler.ProcessRequest(HttpContext context) in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() in System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I solved the issue adding this parameter to the web.config file:
Thanks
Mauro