private void GetData()
{
DataTable dtGlobal = new DataTable();
using (SPSite oCurrentSite = new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb oCurrentWeb = oCurrentSite.OpenWeb())
{
SPList oListResource = null;
SPQuery spQueryResource = new SPQuery();
String queryResource = "";
oListResource = oCurrentWeb.Lists["Service Request"];
queryResource = @"<Where><And><Eq><FieldRef Name='123' /><Value Type='Text'>data</Value></Eq><Eq><FieldRef Name='Unit'/><Value Type='Text'>" + ViewState["GroupName"] + "</Value></Eq></And></Where>";
queryResource = String.Format(queryResource, "Status");
spQueryResource.Query = queryResource;
SPListItemCollection itemsResource = oListResource.GetItems(spQueryResource);
DataTable dtResource = new DataTable();
dtResource = itemsResource.GetDataTable();
gvRInProgress.DataSource = dtResource;
gvRInProgress.DataBind();
}
}
}
No comments:
Post a Comment