In my web part there is the following code, which should filter
list data --> but it doesn't !
SPWeb currentWeb =
Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(Context);
SPList list = currentWeb.Lists[SPEncode.HtmlEncode(listName)];
//without <query></query> it doesn't work --> error in web part
string caml = "<Query><Where><Eq><FieldRef Name='Vorname'></FieldRef><Value
Type='Text'>Patrick</Value></Eq></Where></Query>";
SPQuery query = new SPQuery();
query.Query = caml;
SPListItemCollection listItems = list.GetItems(query);
foreach (SPListItem listItem in listItems){...}
it shows all records, but should only show the filtered records!
can anybody help me ?
Patrick