C# & VB.NET Coding Standards Guides

Clint Edmonson has released a some free C# and VB.NET Coding standards guides to the community to use.  For anyone who wants to download them they can be downloaded below

C# & VB.NET Coding Standards Guides

kick it on DotNetKicks.com

Posted on 12/26/2008 9:47:52 PM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: C# | VB.NET | Visual Studio | Programming

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Converting HTML Hex Color Codes to RGB in ASP.NET

This is another post for my own remembrance. While working with controls in ASP.NET most of the back colors use the RGB color references instead of allowing you to quickly plug in the Hexadecimal numbers to the control.  At first glance this looks to be a daunting task as there doesn’t appear to be a quick solution for this within the Color class in either VB.NET or C#. But the solution is pretty simple

VB.NET Example

  1: MyControl.BackColor = ColorTranslator.FromHtml("#FFFFFF")

C# Example

  1: MyControl.BackColor = ColorTranslator.FromHtml("#FFFFFF");

It actually becomes pretty easy after you find it.  There are some pretty elegant solutions to this problem on the NET but a lot of them don’t take advantage to what Microsoft has already built into the .NET Framework.

Technorati Tags: ,,,

Posted on 9/24/2008 2:03:25 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | C# | Programming | VB.NET

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

VB.NET Equivalent of C# typeof()

I’ve been slowly adding things that I run across that I need to remember to my blog so that I can find them at a later time. As well as allowing other people with the same issue to find a solution for themselves.

  1: typeof(Widget)

is the equivalent in VB.NET of

  1: GetType(Widget)

Now the next time I start looking for this I’ll have it on the blog and easily searchable.

del.icio.us Tags: ,,

Technorati Tags: ,,

kick it on DotNetKicks.com

Posted on 9/24/2008 1:19:36 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: C# | Programming | VB.NET

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

How to sort a DataTable

While working on one of my modules I had a request to be able to sort the items in my DataList alphabetically. This seemed to be a trivial thing as far as I was concerned so off I went.  I was using a DataTable to bind to the DataList control for viewing the links I was building.  So with a quick search on Google I came up with some sample code to give me the basics of what I wanted to accomplish.  So in the following I will present both a C# and VB version of the code for anyone to use in their applications.

VB.NET Version

   1:  Private Function AlphabeticSort(ByVal dtTable As DataTable, ByVal sortOrder As Integer) As DataTable
   2:      Dim dsSorted As New DataSet
   3:      Dim columnKey As String = "TabName"
   4:      Dim sortDirection As String = ""
   5:      Dim sortFormat As String = "{0} {1}"
   6:      Select Case sortOrder
   7:          Case 0
   8:              sortDirection = "ASC"
   9:          Case 1
  10:              sortDirection = "DESC"
  11:          Case Else
  12:              sortDirection = "ASC"
  13:      End Select
  14:      dtTable.DefaultView.Sort = String.Format(sortFormat, columnKey, sortDirection)
  15:      Return dtTable.DefaultView.Table
  16:  End Function

C# Version

   1:  private DataTable AlphabeticSort(DataTable dtTable, int sortOrder)
   2:  {
   3:      DataSet dsSorted = new DataSet();
   4:      string columnKey = "TabName";
   5:      string sortDirection = "";
   6:      string sortFormat = "{0} {1}";
   7:      switch(sortOrder)
   8:      {
   9:          case 0:
  10:              sortDirection = "ASC";
  11:              break;
  12:          case 1:
  13:              sortDirection = "DESC";
  14:              break;
  15:          default:
  16:              sortDirection = "ASC";
  17:              break;
  18:      }
  19:      dtTable.DefaultView.Sort = string.Format(sortFormat, columnKey, sortDirection);
  20:      return dtTable.DefaultView.Table;
  21:      }

As you can see the code is very familiar between the two.  This works excellent for doing an alphabetic sort and very fast as well.

Technorati Tags: , , ,

del.icio.us Tags: , , ,

kick it on DotNetKicks.com

Posted on 2/8/2008 4:50:12 PM by admin

Permalink | Comments (2) | Post RSSRSS comment feed |

Categories: ASP.NET | C# | Visual Studio | VB.NET

Tags: , , ,

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Lightbox Extension for BlogEngine.net

benlogo80Jesse Foster of GravityCube has released a new extension for BlogEngine.net. This extension is designed to overlay images on the current page. The emphasis for this extension is to allow continuous flowing of content without sending the user to a blank page. 

By displaying the image on top of the existing content by simply clicking the image to display and then clicking it again it eliminates the need to click the back button and distract the user from leaving your site or closing out the window expecting to be back at the page.

Jesse based his work for the extension on the following JS script which can be found at http://huddletogether.com/

This extension will definitely be used in my version of BlogEngine.net.

Technorati Tags: , , ,

del.icio.us Tags: , , ,

kick it on DotNetKicks.com

Posted on 1/15/2008 8:20:29 PM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | BlogEngine.NET | C# | Software

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Free PDF Library written entirely in C#

PDFsharpFor those who are looking to find a free alternative to some of the expensive PDF document generation libraries out there I ran across this library thanks to Dmitriy Salko. He mentioned the product on his blog in the following post. He provides a link on his post to directly download the files.

I also took a look at the PDFsharp web site which is the official web site for the project.  They have some work to do on the site but it provides some good starting points for beginning programming with the product.

Below is some of the features of the library:

  • Released Version 1.00
  • Includes support for Unicode in PDF files.
  • Includes MigraDoc Lite for features not present in PDFsharp.

More Information can be found at the following locations:

The download can be found here http://pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=54&Itemid=64

del.icio.us Tags: , ,

Technorati Tags: , ,

Posted on 1/9/2008 12:56:03 PM by admin

Permalink | Comments (2) | Post RSSRSS comment feed |

Categories: C# | Programming | Software

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

ASP.NET Dynamic Data Support in ASP.NET 3.5 CTP

With the release of the first CTP preview of the "ASP.NET 3.5 Extensions" which included the following features:

  • ASP.NET AJAX improvements
    • New additions include support for managing browser history.
  • ADO.NET Entity Framework
    • New modeling framework to better model real world view of information.
  • ASP.NET Dynamic Data
    • Build a fully customizable, data-driven web site app quickly.
  • ADO.NET Data Services
    • Provides new services to find, manipulate and deliver data with simply URI's.
  • ASP.NET MVC
    • MVC (Model, View, Controller) design pattern for the existing 3.5 runtime
  • Silverlight Controls for ASP.NET
    • Provides new Silverlight controls for use within ASP.NET

Now Scott Guthrie has written a great article on his blog on the ASP.NET Dynamic Data component for the CTP.  This feature looks like a great way to get an administration section for a web site up and running really quickly and let you start modifying it to suit your needs once it's complete.  I'm sure I'll use this feature in the future.

del.icio.us Tags: , , ,

Technorati Tags: , , ,

Posted on 1/6/2008 12:17:25 PM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | C# | Software | Visual Studio

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Switching to BlogEngine.net

benlogo80 Having played with several blogging engines over the last few years and having experience in .NET programming since 2000.  I decided to take a look at BlogEngine.net.  I've previously worked with blogs based on .Text, dasBlog and Community Server and they all were interesting and worked well. I was just not crazy about the upgrading of some of these other engines.

Plus as a developer I always like to get under the covers of what is going on in the code to get a good understanding of what the software is doing. Well while browsing http://www.asp.net/ and taking a look at the starter kits, I saw the BlogEngine.net project there.  I proceeded to take a look at the project site for the starter kit and then took a look at the project site on CodePlex.  I then decided to give it a try.

A few years ago I had started work on creating a community site here at Learn MS NET and it didn't pan out quite like I wanted so I had basically mothballed the domain.  I had also been playing around with blog engines at a URL for my business http://blog.shancer.com/ which I had written a few articles for.  So I made the decision in early December to combine both my mothballed site's content which only had a few articles of interest and relevance and the blog posts from my business blog.

Which has led me to using BlogEngine.net and currently working with the latest build from last night at this point.  I ported all my content from dasBlog which was the blogging engine I was using with BlogML.  It took some playing around to get it complete but it worked fantastically for pulling that content in.  I then took and renamed my old community web site and proceeded to copy all the articles out and place on this new site.

Now that i'm becoming familiar with how the source works for BlogEngine.net I will be developing some extensions and helping improve some of the extensions that are already available.  Look for more on this in the future.


Posted on 1/6/2008 11:24:58 AM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | BlogEngine.NET | C# | Personal | Software | Visual Studio

Tags: , , , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Under the Hood: ASP.NET 3.5's Web.config file

Scott Mitchell has written an excellent article on the differences between the 3.5 and 2.0 versions of ASP.NET's Web.config file.  The information he describes is great and gives a much better understanding of what is going on in the configuration of the application in the initial creation of an ASP.NET application.

The article can be read here:

Dissecting ASP.NET Version 3.5's Web.config File

Technorati Tags: , , ,

del.icio.us Tags: , , ,

Posted on 1/1/2008 8:47:02 PM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | C# | Software | Visual Studio

Tags: , , ,

Currently rated 2.0 by 1 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Visual Studio 2008 and .NET 3.5 Training Kit available

While looking through my RSS Feed I ran across Randy Walker's blog post about the Visual Studio 2008 and .NET 3.5 Training Kit being available. I thought it would be a good link to provide to everyone who reads my blog as well as placing it here as a reminder for me to download and take a good look at it.

OverView

The Visual Studio 2008 and .NET Framework 3.5 Training Kit includes presentations, hands-on labs, and demos. This content is designed to help you learn how to utilize the Visual Studio 2008 features and a variety of framework technologies including: LINQ, C# 3.0, Visual Basic 9, WCF, WF, WPF, ASP.NET AJAX, VSTO, CardSpace, SilverLight, Mobile and Application Lifecycle Management.

The Kit can be downloaded at Microsoft here.

Technorati Tags: , ,

del.icio.us Tags: , ,

Posted on 1/1/2008 1:18:27 PM by admin

Permalink | Comments (0) | Post RSSRSS comment feed |

Categories: ASP.NET | C# | Software | Visual Studio

Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5