posted at 10/1/2008 0 Comments
A client of mine had made a request to take the total of a column from the MS DataGrid and in turn, spit it out into a TextBox. Alright... So my first reaction was to loop through each individual record in the grid. It would have worked, but it would not have been pretty, nor speedy by any means. Then I got to wondering if the DataGrid itself had means of calculating the total of a column. I did some quick research on the subject and alas, I could not find a total for the DataGrid. From there I got to thinking, "Well, if the grid is really just an interpretation of it's DataSource, maybe I should be looking at the DataTable?"
Bingo.
textBox1.Text = "$" + dtPurchases.Compute("SUM(Amount)", string.Empty).ToString();
textBox1.Text = "$" + dtPurchases.Compute("SUM(OrigEquityAmt)", "UserName = 'Billy'").ToString();
posted at 2/28/2008 1 Comments
posted at 1/31/2008 0 Comments
w00t! Zune just released their 2.0 firmware. So far it's got a lot of sweet additions that I will be dure to take advantage of. First off, they caught on to the podcast movement, which (to me) is a very fresh experience that I will have to take advantage of. They also sort of revamped their "Social" aspect, allowing the Zune user to share music from Zune-to-Zune, but also off their new social network (don't quote me, I'm still running off of excitement). it kind of appears their social network is similar to that of last.fm in regards that it displays your last play. Anyway, check out my Zune card:
http://social.zune.net/member/nickcdavis
posted at 11/13/2007 0 Comments
woot.com has Brown Zunes for $80 today! YES.
So I officially bought a Brown Zune, the saddest color of them all. I don't have any buyer's remorse yet, and I promised Jacinda that we would get a new faucet for the bath tub. She seemed happy about that. Thanks darling! Hopefully, now that woot.com successfully roped me into buying a Zune, they'll be done with the sales (I'd hate for them to have a cheaper deal in the future).
posted at 10/22/2007 1 Comments
At first, this project of converting my links sounded very tedious. Initially I was thinking I'd have to write some elaborate routine on publishing an HTML page after writing a blog, similar to how blogger does it. Not only would I have to make an HTML page for each blog, but I would have to update the extra content (such as "last 10 blogs") in case I wanted to archive them, keep tabs on a main page, rss feed, etc etc etc. Didn't sound appetising at all.
Dissapointed and overcome by this method, I set on a search to find a nice and easy route. Lo' and behold, Microsoft never ceases to amaze me. URLmappings totally made my life easier. They allow you to set a sort of virtual path to your page, yet, still taking in querystring information.
For example, the link to my recent blog, "Lucky Man". It's original (and working) path is:
http://www.nicholasdavis.info/blog.aspx?bID=346&Blog=Lucky+Man
The after effect of URLMappings is as follows:
http://www.nicholasdavis.info/346/2007/9/27/Lucky-Man.aspx
Sweet, huh? All I had to do was create an XML file that is referencable to my web.config file. For example, I have a file called URLMapping.xml. This contains all my URL Maps. Example:
Now, I reference URLMapping.xml from the Web.Config file of my website:
That's all there is to it! So now when I save a blog, it opens the URLMapping.xml into a Dataset, quick add the links and save it back. Couldn't be easier.
posted at 9/30/2007 3 Comments
posted at 12/7/2006 0 Comments