Showing posts with label CAML. Show all posts
Showing posts with label CAML. Show all posts

How to get distinct value from sharepoint list

Hi All,

Here is code which get distinct value from sharepoint list after using CAML Query.

public static DataTable GetShipType()
{
SPWeb web = SPContext.Current.Web
SPQuery qry = new SPQuery();
qry.Query = "";
DataTable dt = lstFloorPlan.GetItems(qry).GetDataTable();
DataView v = new DataView(tbl); return v.ToTable(true, "Type");
}


That's it.You'r done.
Samip.