0% found this document useful (0 votes)
26 views2 pages

DALlinq

The document discusses code for querying and retrieving data from SharePoint lists. It describes classes like SortParam, Access, QueryExpression, and SPCriteria that are used to build queries. It also provides an example method GetListCollectionByCriteria that takes an SPCriteria object, builds a SPQuery, retrieves the items from a SharePoint list, and returns them.

Uploaded by

Nhan Hong
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

DALlinq

The document discusses code for querying and retrieving data from SharePoint lists. It describes classes like SortParam, Access, QueryExpression, and SPCriteria that are used to build queries. It also provides an example method GetListCollectionByCriteria that takes an SPCriteria object, builds a SPQuery, retrieves the items from a SharePoint list, and returns them.

Uploaded by

Nhan Hong
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Chep nguyen SortParam.cs 2. Lop Access.

cs
SPListItemCollection

va QueryExpression.cs, SPQueryBuilder.cs , CriteriaBase.cs, SPCriteria.cs, => phuc vu cho get list , CriteriaBase co them property :ListName

GetListCollectionByCriteria(SPCriteria

criteria)

{
if (criteria == null) { throw new ArgumentNullException("criteria"); } SPQuery query = this.GetQuery(criteria); if (query == null) { throw new ArgumentNullException("query"); } SPListItemCollection sharePointList = //nhu code cua minh SPListItemCollection queryResults; queryResults = this.sharePointList.GetItems(query); return sharePointList;

}
protected SPQuery GetQuery(SPCriteria criteria) { var spQueryBuilder = new SPQueryBuilder(); spQueryBuilder.MaxRows = criteria.RowLimit; spQueryBuilder.SortParamCollection = criteria.SortParamCollection; QueryColumnCollection queryColumns = null; if (criteria.Columns.Count > 0) { queryColumns = criteria.Columns; } spQueryBuilder.Columns = queryColumns; } return spQueryBuilder.BuildQuery(criteria.QueryExpression);

GetById
public DataTable LoadTable()

{ SPListItemCollection SharePointList = GetListCollectionByCriteria if (SharePointList == null) { return null; } if (SharePointList.Items == null) { return null; } return SharePointList.Items.GetDataTable(); } }

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy