Monday, August 18, 2008

Here is a really nice simple way of seeing how big the data in your table/column is. I often use this for maintenance to see over time how much data is being entered into a column. If the database has been in use for a while and you see that the majority of the data being entered is smaller then the size of the column you can go back and change the varchar/char data columns. This will save you space and performance over the lifetime of your application.
SELECT
ColumnName, LEN(ColumnName) Length
FROM
dbo.EventLog
GROUP BY
ColumnName
ORDER BY
Length DESC

Friday, March 14, 2008

Hello all,

I just found out about this and have to post a comment just to get more attention for it. I'm a Google gmail user and love the gmail system, except that there isn't a way to create sub-folders/labels. In any case it's my favorite online mail system. When I found this article talking about emails, large numbers of them just disappearing from peoples inbox I was very disappointed to find that Google is not concerned with it. I really hope Google gets on this and finds out what's happening. At least by more helpful to the people using the service and be real about it.

Thursday, February 07, 2008

I just thought this little piece of code was useful and I didn't find much in my google searches for doing this cleanly so here you go.

Creating a drop down list of the months in a year with their name and numeric value.

for (int i = 1; i <= 12; i++)
{
DateTime datetime = new DateTime(1, i, 1);
string month = datetime.ToString("MMMM");
dropdownlist.Items.Add(new ListItem(month, i.ToString()));
}

Thursday, January 10, 2008

I've stumbled across another asp.net related problem that I think should be easier then it is. I've started using the SqlDataSource control which can be great because it allows you to do a sort of "Live" edit of the selected data. This is all great except for the fact that the only way I can get it to work is if the data I'm selecting and binding to a grid is bound on when the page is loaded the first time.

The problem this creates is that there is no way to enter some search criteria and then click a button to execute the search, bind the results to the grid and then edit the results. The edit part of the functionality is now broken. I don't know why Microsoft designed the DataSource controls like this because it makes them useful in only the simplest of scenarios.

I've started a Google Groups post here if you want to see the progress on this. You can always post comments here as well.

Maybe I'm just missing the point of the DataSource controls and maybe there are newer more advanced controls that I am not aware of. Microsoft has been developing new technologies at such a fast rate that I can't keep up with everything.

Wednesday, January 09, 2008

I just had to share this photo of Yosemite I took the day before Christmas. I would highly recommend that you visit Yosemite in the winter time and when there is snow on the ground. It's a magical place.