Ejemplo n.º 1
0
        public static SPListItemCollection FindItems(this SPList list, string fieldName, string fieldValue)
        {
            SPQuery myquery = new SPQuery();

            string internalName = string.Empty;
            string type         = string.Empty;

            list.GetColumnProperties(fieldName, out internalName, out type);

            myquery.Query = string.Format(@"<Where><Eq><FieldRef Name='{0}' />
                                                        <Value Type='{1}'>{2}</Value>
                                                    </Eq>
                                            </Where>", internalName, type, fieldValue);
            return(list.GetItems(myquery));
        }