protected void Page_Load(object sender, EventArgs e)
{
var procad = WS.SubCategories.Where(v => v.SUBID == int.Parse(Request.QueryString["id"])).FirstOrDefault();
doldur();
}
public void doldur()
{
var prode = WS.Bloglarims.Where(v => v.SUBID == int.Parse(Request.QueryString["id"])).ToList();
CollectionPager1.DataSource = prode;
CollectionPager1.BindToControl = dtList;
dtList.DataSource = CollectionPager1.DataSourcePaged;
}
Loading
Scott LyslePosted Aug 15, 2013, 7:48 AM
Using the orders table from the northwind database, it could be done with something like this where I just ordered the orders by date for a given customer ID and then picked off the first one. Again, you could also just take the max date for the records.
private void cboCustomerId_SelectedIndexChanged(object sender, EventArgs e)
{
string currentCustomer = cboCustomerId.SelectedItem.ToString();
NorthwindDataContext context = new NorthwindDataContext();
Order newestOrder = (from a in context.Orders where a.CustomerID == currentCustomer orderby a.OrderDate descending select a).First();
MessageBox.Show(newestOrder.OrderID + " :: " + newestOrder.OrderDate);
}