A C# Quick Tip: You’ve probably seen ‘break’ before in Switch Case statements, but it also plays an important role in Foreach Loops. To break completely out of a foreach loop (foregoing all the remaining loops), use: break; To go to the next iteration in the loop, use: continue; When is ‘break’ useful? It is [...]
C#: That Pesky DBNull Error in Datatables
by byron on March 15, 2010 in ASP.NET/C#
Datatables and Tableadapters are one of the most beautiful things about C# and Visual Studio, until you’re processing rows in your datatable and you get something that reads like “The value for column ‘your_column’ in table ‘your_table’ is DBNull.” If you go a little further, you may get: “Exception Details: System.InvalidCastException: Specified cast is not [...]
C# – SQL Server Foreign Key, Unique constraints
by byron on May 27, 2009 in ASP.NET/C#, SQL
I got tripped up today with a particularly nasty Join statement that worked perfectly form 90% of the queries, but was blowing up at times. The error message was: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. I looked and looked at this SQL code: It looked [...]
Get ASP.NET DropDownList Selected Value with jQuery
by byron on October 31, 2008 in ASP.NET/C#, Javascript Frameworks, Web Development
With Microsoft’s recent announcement that they will begin shipping jQuery with Visual Studio, the little Javascript framework is about to hit the big time (it was already sort of big time, but this is BIG TIME). And rightfully so. I have been a Prototype and Scriptaculous user for over a year now. But I am [...]
ASP.NET – C# – Emulating the VB Control Array – Pt. 1
by byron on October 29, 2008 in ASP.NET/C#
For you veterans of VB6, the control array probably became an old friend, or at least an annoying neighbor if you didn’t like them. You couldn’t help run across the concept in VB6 because every time you copy and pasted a control for the first time, you got asked if you wanted to create a control array. If [...]
ASP.Net C# – PHP Equivalents
by byron on September 17, 2008 in ASP.NET/C#
On this post, I will be collecting ASP.NET C# commands that I use frequently in PHP but I have to continually look up in the little bit of ASP.NET that I do. PHP can be frustrating for its inconsistencies in syntax, but what is even more frustrating is when you’re trying to do something in [...]
ASP.NET/C#: Convert HTML Colors to System.Drawing.Color
by byron on May 14, 2008 in ASP.NET/C#
HTML colors come in all sorts of flavors: hexadecimal (#0066ff), named colors (e.g. LightSkyBlue…here’s the link). Many people may be very comfortable with working with HTML colors, so if you’re in C# and needing to get the .Net equivalent, you can translate directly from HTML colors with System.Drawing.ColorTranslator.FromHtml(). Here’s the usage: System.Drawing.Color myColor = System.Drawing.ColorTranslator.FromHtml(“Red”); [...]
Recent Posts
Popular Posts
- Excel Spreadsheet of US States
- Get ASP.NET DropDownList Selected Value with jQuery
- Javascript: How to get an Object's ID
- ASP.NET - Get User Name Under Windows Authentication
- SAP: Deciding about SAP-BPC (nee Outlooksoft)
- WordPress: Get Category ID for a Category Page
- PHP: What is the & Ampersand Preceding Variables
Tags
Categories
- Accounting (1)
- adobe air (1)
- ASP.NET/C# (16)
- Blogging (8)
- Books/Movies (1)
- Food/Travel (1)
- Google (1)
- iOS (3)
- iTunes/iPod (1)
- Javascript Frameworks (3)
- jQuery (3)
- Mac (4)
- Microsoft Excel (7)
- Microsoft Outlook (1)
- Miscellany (13)
- PHP (8)
- Productivity (6)
- Programming (7)
- SAP (52)
- Software (2)
- SQL (2)
- Web (5)
- Web Development (13)
- WordPress (18)
- WordPress Plugins (3)
- WordPress Themes (3)
- Words/Quotes (1)
- Worksoft Certify (6)
- YouTube (2)


