Monday, March 26, 2007

Using VB keywords as Variables

This is something I figured out awhile ago but haven't bothered to post it until now. Like I mentioned in an earlier post, I have started using VB.Net at work. As I was trying to convert some sample from C# to VB.Net, I ran into a problem. In C#, a name of a get/set accessor was not a keyword but in VB.Net it was. No matter what libraries or how many different online code converters I tried, I could not get it to work. I finally resorted to google and found out that you can surround a keyword with brackets ([ ]) and than you can use that keyword however you need. In my case it allowed me to use custom sinks in .NET Remoting. Here's an example:

Dim [New] as String
New = "Blah"

As a very BIG note: Be careful when using it. When you can name something other than a reserved keyword, do so. It can cause many issues if you use this unwisely.

Rounded Corners

Every time I start a new web project I want to have create tons of little rounded corners for my web site. It's a pain because I'm not great at PhotoShop and it's a hassle if I want to change colors. I found a JavaScript library that does all of the rounded corners on the fly. It seems to have a lot of customizations that you can add and play with. The only bad thing is that it is a JavaScript library and you have to add a command to initiate the rounded corner creation. However, I think that you could very easily customize to pull the parameter from the div tags parameters and automate everything without any custom JavaScript in your HTML page. Anyways, check it out and use it however you can.

http://www.ruzee.com/blog/shadedborder

Wednesday, March 21, 2007

Typed Datasets

I've heard of typed datasets before but I just started using them on my current project. Wow, they're cool. Typed datasets are cool because you predefine the structure of the dataset (tables, columns, relationships, etc.) through Visual Studio 2005. Once defined, Visual Studio generates the code to create the class for the typed dataset. Now you get all the nice features of typical dataset but you can now also access the data in a type safe way. Instead of accessing the value of a column in row using:

currentColumn("ColumnA")

you can do this:

currentColumn.ColumnA

This is nice because a change of the data structure will cause compilation errors instead of runtime errors (runtime errors bad). Typed datasets are very cool. Microsoft has a very good tutorial on typed datasets: http://msdn2.microsoft.com/en-us/library/aa581778.aspx

Tuesday, March 20, 2007

FTP and .NET 2.0

One of my current projects has a requirement to send files programmatically via FTP. I found some great resources out there but the most useful is this one:

http://www.codeproject.com/vb/net/FtpClient.asp


The main point of his post is that he made a library for FTP'ing built on the FTPWebRequest object built into the .NET 2.0 framework. He does a great job of explaining the basics of using FTPWebRequest and then goes into details about his library. I found this article very helpful.

Thursday, March 08, 2007

Project Time Tracking

I do several side projects that require me to track the time I spend programming on each project. I found a site that allows you set up projects and start tracking their time. It works very well and is cool due to the AJAX features that it has. It also has very nice reporting feature.

http://www.toggl.com/

Righ Click Context

I found this article about creating context sensitive right click context menu. You can display pretty much anything that you want. It's a very slick implementation:

http://www.harelmalka.com/rightcontext/

Reading and Writing an Encrypted DataSet to Dis

My current project requires that I store a strong-typed dataset to the file system for offline storage. After doing some researching, I found this very helpful blog entry:

http://weblogs.sqlteam.com/davidm/archive/2006/06/13/10195.aspx

It basically serializes the dataset object, encrypts the serialization and then writes the resulting encrypted stream to file. It works great.