-
Archives
- November 2023
- July 2023
- June 2023
- March 2023
- February 2023
- October 2022
- July 2022
- June 2022
- May 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
- September 2021
- August 2021
- June 2021
- May 2021
- March 2021
- February 2021
- November 2020
- October 2020
- September 2020
- August 2020
- July 2020
- June 2020
- April 2020
- March 2020
- February 2020
- January 2020
- December 2019
- November 2019
- October 2019
- September 2019
- July 2019
- June 2019
- April 2019
- March 2019
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- January 2017
- December 2016
- November 2016
- October 2016
- August 2016
- July 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- September 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- January 2015
- November 2014
- October 2014
- September 2014
- August 2014
- June 2014
- April 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- September 2013
- August 2013
- July 2013
- April 2013
- March 2013
- January 2013
- December 2012
- November 2012
- October 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- February 2012
- November 2011
- October 2011
- August 2011
- July 2011
- May 2011
- April 2011
- March 2011
- February 2011
- January 2011
- December 2010
- November 2010
- October 2010
- August 2010
- June 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
-
Meta
Category Archives: C#
Feature Debugging flags
I chuckled today when I received an add from launchdarkly.com. They’re a “feature flag” SaaS provider. I explained the concept of feature flags to a non-software-developer just a few weeks ago, so maybe my phone was eavesdropping. I was amused … Continue reading
Posted in C#, Musings, Programming
Leave a comment
Open the application folder, Hal.
Some applications *cough ClickOnce cough cough* hide in difficult-to-find folders, with auto-generated paths that include GUIDs. Here’s an easy way to open the application folder, and also the config file. And the local application data folder, because of course you’re … Continue reading
Posted in C#, Programming
Leave a comment
Simplified switch
I commonly included this code at the end of a C# switch statement, in a misguided effort to proactively satisfy the syntax of the switch statement: switch (contentType) { case FraMES.ContentTypes.Something: do stuff for Something; break; default: throw new Exception(“FraMES.ThisMethod … Continue reading
Posted in C#, Programming
Leave a comment
C# Pragma to disable unused constants
A somewhat dated style of coding, commonly seen in WinAPI code, creates a list of constants for use in called methods. Occasionally I find this concept handy and illustrative, such as when using 32-bit resources because the 64-bit equivalent is … Continue reading
Posted in C#, Programming
1 Comment
Updating nullable DataTable columns
While NULL is a standard feature and business-as-usual in the SQL world, and likewise null objects are common in the C# world, the concept of NULL and null are completely different things and the translation is easily forgotten. This is … Continue reading
Posted in C#, Programming, SQL Server
Leave a comment
Display a Tooltip when the user hovers the mouse over a control
AKA mouseover, hovertext. To display a message over one specific control string message = WORKCENTERS_FOR_ROUTESTEP_STRING + lbRouteSteps.SelectedItem.ToString(); lblSelectedRouteStep.Text = message; System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip(); ToolTip1.SetToolTip(this.lblSelectedRouteStep, message); For displaying over multiple controls on a form Instantiate … Continue reading
Posted in C#, Programming
Leave a comment
End of Line
StringBuilder sb = new StringBuilder(“Part of some text”); sb.AppendLine(); // adds a Windows-style CRLF end-of-line. /r/n is Windows-style. That’s ASCII 13, ASCII 10. The great drscoinc.com cialis generika condition implies to unevenness of reproductive health and emotional health professionals, they … Continue reading
Posted in C#, Programming
Leave a comment
Change a DataTable cell value
This is stupid simple, but it’s so stupid simple that I forget about it.
Posted in C#, Programming
Leave a comment
C# name of calling method plus current method
StackTrace st = new StackTrace(); throw new NotImplementedException(st.GetFrame(1).GetMethod().Name + “.” + System.Reflection.MethodBase.GetCurrentMethod().Name + ” is not yet implemented.”);
Posted in C#, Programming
Leave a comment
Retrieve a null database value into a GUID variable using C#
Guid aca_coc_signature_id = (dtDocument.Rows[0].Field<Guid?>(“aca_coc_signature_id”)); The type decorator “?” makes the Guid nullable. Another approach is: if (dtDocument.Rows[0].IsNull(“aca_coc_signature_id”)) { aca_coc_signature_id = System.Data.SqlClient.Guid.Null; } There are more than 100 types of arthritis. viagra 25 mg offscriptband.com This medicine works wonders only if … Continue reading
Posted in C#, Database, Programming
Leave a comment