Hello everyone,
Okay so here is what i am looking into now:
PROFILE.ASPX // the profile page of my social network site
Code:
protectedvoid Page_Load()
{
string conString = WebConfigurationManager.ConnectionStrings["myconnection"].ConnectionString; // okay here
DataContext db = newDataContext(conString); // seems simple enough...
var tMessages = db.GetTable<Messages>(); // getting into new territory but i still get it.
tMessages.Where(m => m.Read == 0); // This is kinda neat but i want the number of items in the list who have the Read property set to 0 (for false) so i can make my link button say "you have {0} messages!"
// and i was taking a shot in the dark thinking i'd be using something similar to this, in the sense of using the Sum method.
tMessages.Sum(m => m.Read == 0);
}
now i was thinking of posting this list of unread messages to the next page:
VIEWMESSAGES.ASPX
Code:
protectedvoid Page_Load()
{
if (Page.PreviousPage != null)
{
// I was thinking of making a property on the previouspage i could grab the value from via this page and this property holds the list of messages (preferably just the new ones like so:
// PreviousPage.Property
// if that is something a professional developer wouldnt agree with, then perhaps it would be better to repeat the process of getting the unread messages list and databind it to a gridview
}
}
now this line here:
Code:
tMessages.Where(m => m.Read == 0);
my understanding of it is "in the Messages table where all Read messages are 0 (false)
im not sure what the "greater than equals to is for" ( => )...
anyways thanks for reading my multipart question. :)