Category Archives: C#

List of line endings

programmingScriptText += “\r\n”; //Windows style CRLF line ending. //programmingScriptText += “\n\r”; // Nobody does this. //programmingScriptText += “\r”; // Max style (CR) line ending. //programmingScriptText += “\n”; //UNIX style (LF) line ending.

Posted in C#, Programming | Leave a comment

C# Make a SplitContainer dragbar visible to users

/// /// Given a SplitContainer, /// set the color of its background to make the splitter dragbar visible to users. /// Set the color of the splitter’s panels to the original color of the splitter, /// to keep their backcolors … Continue reading

Posted in C#, Programming | Leave a comment

ClickOnce, Crystal Reports, and dependent projects

Problem causing failure to install ClickOnce project after adding a reference to another project: ERROR DETAILSERROR DETAILS Following errors were detected during this operation. * [7/17/2017 12:01:25 PM] System.Deployment.Application.InvalidDeploymentException (RefDefValidation) – Reference in the manifest does not match the identity … Continue reading

Posted in C#, Linkdump, Programming, System/DB Administration | Leave a comment

Log files and Fail-friendly code

Oh my goodness. Thoughts for the day… Log file-based troubleshooting of deployed applications in limited-access environments has to be one of the most frustrating processes of application development. Magic numbers are EVIL. Lack of default cases is EVIL. Long strands … Continue reading

Posted in C#, Musings, Programming | Leave a comment

C# SystemColors class

I set the design-time background color of by-default-invisible controls to a vibrant Pale Green as an indication to the designer/developer/myself that this control won’t be visible unless made so. When working with the by-default-invisible controls, I typically change the .BackColor … Continue reading

Posted in C#, Programming | Leave a comment

Save a null value to a GUID field using C# SqlParameter

sCommand.Parameters.Add(“@employee_id”, SqlDbType.UniqueIdentifier).Value = (processEmployee_id == String.Empty ? System.Data.SqlTypes.SqlGuid.Null : new Guid(processEmployee_id));  

Posted in C#, Programming, SQL Server | Leave a comment

C# columnar Time zone conversions on populated DataTables

TLDR; the code below converts a DataTable’s time columns from UTC to local time, even when the DataTable is populated with data. My utility framework for general data displays queries a predefined content-specific DataTable into a DataGridView. The columns are automatically handled by … Continue reading

Posted in C#, Programming | 2 Comments

Easy way to apply filter to DataTable

Problem: Cannot directly apply a filter to a datatable. The application requires dynamic filtering for various criteria, altered at runtime by the user. Re-querying the database is not feasible; filters must be applied at the client upon a local DataTable. … Continue reading

Posted in C#, Programming | Leave a comment

Some free C# charting components / tools

Free C# Grid/Graph component Best Free Controls for .NET [closed] Which .net charting library should I use? ZedGraph: A flexible charting library for .NET   Thanks to  

Posted in C#, Programming | 1 Comment

Time to see what the other side is doing (moving from windows forms development to web apps)

I’ve been coding winforms for internal use. For the most part, I stick to professional standards, but I am willing to release less-polished applications than if I were selling them. Part of the implication of this is that I don’t … Continue reading

Posted in C#, Programming | Leave a comment