// Business Ojbect reference protected DisplayItems oItems; protected DataSet dsNews; proteced DataSet dsEvents; protected void Page_Load(object sender, EventArgs e) { this.oItems = (DisplayItems)RegisterBizObj(new DisplayItems()); // Get News Items - The last parameter is the table name I want the data in. this.dsNews = this.oItems.GetItemsDataSetByType(DisplayItemType.News, false, "News"); if (this.dsNews.Tables[0].Rows.Count > 0) { this.grdNews.DataSource = dsNews this.grdNews.DataBind(); } // Get the Event Items this.dsEvents = this.oItems.GetItemsDataSetByType(DisplayItemType.Events, false, "Events"); if (this.dsEvents.Tables[0].Rows.Count > 0) { this.grdEvents.DataSource = dsEvents; this.grdEvents.DataBind(); } } // In my business Object the method looks like this. public DataSet GetItemsDataSetByType(DisplayItemType itemType, bool isPrivate, string tableName) { // 1-18-2008 Adding a check for expire date DateTime rightNow = DateTime.Now; return this.GetDataSet("SELECT * FROM DisplayItems WHERE ItemType = @Type AND MarkPrivate = @Private AND @RightNow > BeginDate AND @RightNow < ExpireDate ORDER BY DateOfItem DESC", tableName, this.CreateParameter("@Type", itemType), this.CreateParameter("@Private", isPrivate), this.CreateParameter("@RightNow", rightNow)); }Again in my case the data was display only; not going to be edited and it wasn't going to still be on the business object later anyway. If you need to save this data to do something with later you can save it to the session after you retrieve it as well. Something like this.
// After retrieving the DataSets Session["dsNews"] = this.dsNews; // Later, on a postback you can get this data back from the session and make it current on the business object again. this.dsNews = (DataSet)Session["dsNews"] this.oItems.SetCurrentDataSet(this.dsNews);I hope this helps some.