I am having the following scenario. All day something I am testing has been working fine. but suddently I start receiving this error when I try to do the following line:
query.RowLimit = 1;
SPListItemCollection itemsMeetings = listMeetingsRoot.GetItems(query);
if (itemsMeetings.Count == 1)
{
I am not going to show the full code because I think the error is related to sql server. but I dont know what to check 1. I checked tempdb it has 7mb of space. 2. I checked content database it has 60mb of data.
some errors I can see in the logs are:
Unable to execute query: Error 0x80131904
SqlError: 'Incorrect syntax near ')'.' Source: '.Net SqlClient Data Provider' Number: 102 State: 1 Class: 15 Procedure: '' LineNumber: 1 Server:
...spaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon. Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.Sql...
there are too many sql errors in the log, so I dont know what can I check
string startDateStr = startDate.ToString("s"); #endregion
#region Get Next meeting
SPQuery query = new SPQuery();
query.Query = string.Concat(
"<Where>",
"<And>",
"<BeginsWith>",
"<FieldRef Name='" + Meetings.Common.Constants.FIELDS_TEXT_TITLE_NAME + "' />",
"<Value Type='Text'>" + type + "</Value>",
"</BeginsWith>",
"<Ge>",
"<FieldRef Name='" + Meetings.Common.Constants.FIELDS_EVENTDATE_NAME + "' />",
"<Value Type='DateTime' IncludeTimeValue='TRUE'>" + startDateStr + "</Value>",
"</Ge>",
"</And>",
"</Where>");
query.RowLimit = 1;
SPListItemCollection itemsMeetings = listMeetingsRoot.GetItems(query);
#endregion
#region Get url of next meeting site
if (itemsMeetings.Count == 1)
this is the generated query
<Where><And><BeginsWith><FieldRef Name='Title' /><Value Type='Text'>BD</Value></BeginsWith><Ge><FieldRef Name='EventDate' /><Value Type='DateTime' IncludeTimeValue='TRUE'>2012-08-15T00:00:00</Value></Ge></And></Where>