Bind List Items To a Grid Programatically
private void GetHRNewsletters() { using (SPSite osite = new SPSite(SPContext.Current.Web.Url)) { using (SPWeb oweb = osite.OpenWeb()) { string currentYears = DateTime.Now.Year.ToString(); DataTable dtListItem = new DataTable(); dtListItem.Columns.Add("Title", typeof(string)); dtListItem.Columns.Add("URl", typeof(string)); dtListItem.Columns.Add("Month", typeof(string)); //dtListItem.Columns.Add("Month", typeof(string)); SPList olist = oweb.Lists.TryGetList("HRNewsletter"); SPQuery qurryclienttestmonialcollection = new SPQuery(); string stringQueryclienttestmonial = string.Format(@"<Where><Eq><FieldRef Name='FiscalYear' /><Value Type='Lookup'