I have a query I created using U2U CAML query. I am able to retrieve all the information within the builder, but when I use in VS I am returning everything seems like. Unless while debugging I am checking the wrong things. Need to verify that it is correct and should work in VS.
BTW, I checked the forum so it seems correct, may just need another set of eyes sometimes....code running together
using (SPSite siteCol2 = new SPSite("http://dev.portal.net/it/dev"))
{
using (SPWeb web2 = siteCol2.OpenWeb())
{
SPList groupList = web2.Lists["Approvers"];
//Write SPQuery/CAML query
SPQuery myquery = new SPQuery();
myquery.Query =
//"<Query>" +
"<Where>" +
"<And>" +
"<Contains>" +
"<FieldRef Name='Group' />" + "<Value Type='Text'>PO</Value>" +
"</Contains>" +
"</And>" +
"</Where>";
//"</Query>";
SPListItemCollection items = groupList.GetItems(myquery);
Console.WriteLine(myquery);