Wednesday, April 30, 2014

Tip of the Day

When working with column names in your DataGridView, always refer to them as Column.Name, rather than "ColumnName".

Example:

Select Case colCheckBox
            Case "colApprovedByExecutive"
                If desiredCheckboxStatus = True Then
                    cellDate.Value = DateTime.Now().ToString()
                    cellUsername.Value = GetLoggedInUser()
                Else
                    cellDate.Value = New DateTime(1753, 1, 1)
                    cellUsername.Value = String.Empty
                End If
End Select  
Simply, don't do this. When you remove columns, rename them, or whatever, you'd have to search through the solution for every last one. Instead, use:


Case colApprovedByExecutive.Name     ...

Since you're just referencing the actual columns, you will only get a compilation error. That is *much* more visible than the alternative and will make your code easier to work with.

P.S.: My recent posts may have had nothing to do with C#. I will probably be moving over to a more IT/General Development style. I will also be posting more tidbits such as this. :)

Monday, April 21, 2014

Team Foundation Server - Unshelving

Why does TFS ask us if we want to save changes to our local project when we unshelve a shelveset for that same project? The fact that we are unshelving changes obviously means we want to overwrite any local changes with the shelveset files. So why would they ask us that question? If you click No to saving changes, you're probably fine. But if you click yes - BOOM! Errors abound. You have to undo the pending changes you just unshelved, then unshelve them again. What a waste of time. Better hope you preserved the shelveset or took a backup, because if you didn't you're fucked.

Wednesday, April 9, 2014

Windows 7 update

Microsoft, if you can't restore all of our open programs and documents when you decide to update and restart without asking us, then don't fucking update.

Sunday, April 6, 2014

Oracle SQL Developer

As far as usability and presentment is concerned this program is seriously a joke. If you have been using SQL Server for years, and you try to use this DBMS, it's incredibly frustrating. Every common function you want to perform won't have a button, or even a menu option. It's a keyboard shortcut. For example, to start a new query tab in Oracle SD, you have to type Ctrl + Shift + N. There is no button, menu item, and to boot, it was not easy to find searching on the net. Are you fucking kidding me? Did you not think that would be a common feature that we would like to just click? In SQL Server, you just click New Query.

Similarly, code comments has no button either. It's a keyboard combination: Ctrl + /. Whoever made this software, I have a message for you: Welcome to the 2000s. We have GUIs now. Did you miss that?