.net, programming

Get the root part of a domain in .NET

Need to get the .com, .us, .biz, etc. part of the domain name in .NET? Here’s how: Dim root As String root = Right(Request.Url.Host, (Request.Url.Host.Length) – InStrRev(Request.Url.Host, "."))Dim root As String root = Right(Request.Url.Host, (Request.Url.Host.Length) – InStrRev(Request.Url.Host, "."))

.net, programming

How to use the My Namespace in C#

When I was first trying to transition from VB.NET to C# I found it pretty odd that the “My” Namespace wasn’t available in C#.  If you aren’t aware of what I’m talking about, the Microsoft.VisualBasic.MyServices namespace (My in Visual Basic) provides easy and intuitive access to a number of .NET Framework classes, enabling you to write code that interacts with the computer,…

Continue Reading

.net, programming, user groups

CMAP Main Meeting – Tuesday, December 7th – IIS Express, Razor, and WebMatrix, OH my!

CMAP Main Meeting – Tuesday, December 7th – IIS Express, Razor, and WebMatrix, OH my! – G. Andrew Duthie When: Tuesday, November 7th, 6:30 PM – 9:00 PM Where: HCC Business Training Center, 6751 Columbia Gateway Drive, MD, 21046 Topic: IIS Express, Razor, and WebMatrix, OH my! Does the announcement of so many new technologies make you wonder where the…

Continue Reading

.net

FredNUG tonight

I’ll be attending the Frederick .NET user group tonight.  Tonight’s topics will be SQL Server Performance and Coding for Fun and Profit.  More information can be found here.

.net

FormView and ObjectDataSource with nullable types

I recently ran into this problem when using a FormView and and ObjectDataSource where the FormView was binding to nullable data types… Here is a challenging question, as I have not found any suitable information on this after two days of searching: Background: I have a custom Business Class library that includes custom objects with nullable int and DateTime properties.…

Continue Reading

.net

FormView not retaining values when server-side validation fails

I recently spent quite a bit of time trying to figure out why my FormView wasn’t retaining values after some of my custom server-side validation failed in my business logic layer.  I kept seeing that you just had to set KeepInEditMode = true (or KeepInInsertMode if you’re doing an insert) and that would take care of it. Well, after a…

Continue Reading