How To
How to Read a custom config section from app.config in C#
3/20/2025 1:48:17 AM 22
In this article, I’ll show you how to retrieve a custom configuration section from app.config and load it into your own configuration class.
Duplicate 'AssemblyVersion' attribute in C#
3/20/2025 1:35:43 AM 29
When you try to add the AssemblyVersion attribute to your project, for example, to auto-increment the version:
Invoke or BeginInvoke cannot be called on a control until the window handle has been created
3/20/2025 1:32:36 AM 11
In a WinForms project, if you try to call Invoke or BeginInvoke on a control before the window handle has been created, you'll encounter the following exception:
How to convert string into Secure string in C#
3/19/2025 8:40:37 AM 777
A SecureString in C# is designed to securely store confidential information such as passwords and PIN codes. It ensures that sensitive data is encrypted and remains protected in memory.
How to retrieve the Executable Path in C#
3/19/2025 8:38:39 AM 2.96K
In C#, you can retrieve the executable path of the current application using the System.Reflection namespace.
Connection string password with special characters in C#
3/19/2025 8:34:39 AM 1.95K
When you create a connection string in C# that includes a password with special characters, it's important to properly format and escape those characters to ensure the connection string is interpreted correctly.
Async/Await with a Func delegate in C#
3/19/2025 8:29:30 AM 320
To make a Func delegate awaitable, you need to return a Task from the delegate.
How to use a list of tuples in C#
3/19/2025 8:28:52 AM 225
In C#, a list of tuples can be used to store a collection of data where each element contains multiple values.
How to set time to 00:00:00 with GETDATE() in SQL
3/19/2025 8:26:05 AM 1.58K
In SQL Server, if you want to set the time part of the current date to 00:00:00 while using GETDATE(), you can use the CAST or CONVERT function to strip the time portion.
The name 'Session' does not exist in the current context
3/19/2025 8:19:34 AM 1.66K
In ASP.NET Core, the Session feature is not enabled by default and must be explicitly configured.
Implementing Two-Factor Authentication with Google Authenticator in ASP.NET Core
3/19/2025 8:18:53 AM 262
In this article, we'll explore how to implement two-factor authentication (2FA) in an ASP.NET Core web application using Time-Based One-Time Password (TOTP) apps, like Google Authenticator and Authy.
SQL Bulk Insert with SqlBulkCopy in C#
3/19/2025 8:08:17 AM 49
When dealing with a large number of records, especially in scenarios where inserting a lot of data into the database, a Bulk Insert can drastically improve performance over executing individual INSERT statements. Bulk Insertion can be up to 20x faster than inserting records one by one.