Anyone have experience with the SPQuery class? I am getting the following error on trying to use the GetItems(spQuery method).
Message: SQL Server Error. The SQL Server might not be started.
Source: Microsoft.SharePoint
Stack: at Microsoft.SharePoint.Library.a.a(String A_0, String A_1, String A_2, String A_3, Boolean A_4, Boolean A_5, Boolean A_6, UInt32& A_7, UInt32& A_8, Object& A_9, String& A_10)
at Microsoft.SharePoint.SPListItemCollection.a(Boolean A_0)
at Microsoft.SharePoint.SPListItemCollection..ctor(SPList A_0, SPQuery A_1, String A_2)
at Microsoft.SharePoint.SPListItemCollection..ctor(SPList A_0, SPQuery A_1)
at Microsoft.SharePoint.SPList.GetItems(SPQuery query)
at VacationRequestHandler.VacationRequestHandler.OnEvent(SPListEvent evSharepointEvent)
The following is my code sequence:
SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef Name='Requested_x0020_By'/>" +
"<Value Type='Number'>" + userID + "</Value></Eq></Where>";
//The following line throws the error
SPListItemCollection myItems = list.GetItems(query);
However, SQL Server is obviously started, because I can access the list in its entirety by using list.items instead of list.GetItems(query).
Anyone have any suggestions? Is it a problem with how I formatted the query string?