Ok, I’ve been hacking around this particular problem for a month now, but think I’ve got a bead on how to stop it. So, I hope this helps someone! The Situation I’ve got a TableAdapter in C# and I’m using a Query to return a scalar value that ultimately becomes a double data type. The [...]
C# – NullReferenceException with TableAdapter and Scalar Values
by byron on December 6, 2011 in ASP.NET/C#, Programming
C# / VSTO – Using Excel Ranges
by byron on November 28, 2011 in ASP.NET/C#, Microsoft Excel
Using Visual Studio Tools for Office (VSTO) with Excel lets you use C# (or your other favorite .NET language to leverage the power of Excel. But you will have to learn how the syntax for the Excel object model as opposed to just using VBA syntax. This post shows you how to use Excel ranges [...]
C# – VSTO – Get Last Used Row or Cell in Excel Spreadsheet
by byron on October 25, 2011 in ASP.NET/C#
I have had the opportunity to get my fingers dirty with Visual Studio Tools for Office, at long last. My project brought me back to an old familiar problem in Excel, finding the last used row in a spreadsheet. This applies equally to C#, VB, and VBA. You just have to get access to the [...]
C#: Break vs. Continue in Foreach Loops
by byron on March 16, 2010 in ASP.NET/C#
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 [...]
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)


