How To
How to prevent target blank links from opening in a new window in Cefsharp
By Tan Lee Published on Jul 03, 2024 650
In CefSharp, which is a .NET wrapper for the Chromium Embedded Framework (CEF), you can control how links with target="_blank" are handled.
How to fix System.InvalidOperationException: Scheme already exists: Identity.Application
By Tan Lee Published on Jun 17, 2024 2.22K
The error message System.InvalidOperationException: Scheme already exists: Identity.Application typically occurs when you're trying to add Identity to your ASP.NET Core project, but the scheme "Identity.Application" is already registered in the authentication options.
How to handle nulls with SqlDataReader in C#
By Tan Lee Published on Dec 24, 2024 1.4K
The SqlDataReader object, which is used to read data from a SQL Server database, returns DBNull when it encounters a NULL in a column.
Update records with Dapper in C#
By Tan Lee Published on Jan 18, 2025 567
You can update records in a database using Dapper by leveraging the Execute() method along with an UPDATE statement.
How to hide the Console Application in C#
By Tan Lee Published on Jun 08, 2024 10.33K
To hide a console application in C#, you can utilize the ShowWindow function from the user32.dll library to hide the console window programmatically.
How to group by multiple columns using LINQ
By Tan Lee Published on Dec 10, 2024 331
In LINQ, you can group by multiple columns using the group by clause in combination with anonymous types.
How to search for files in folder in C#
By Tan Lee Published on Nov 21, 2024 521
To search for files in a folder in C#, you can use the Directory.GetFiles method from the System.IO namespace.
How to hide “Showing 1 of N Entries” with jQuery datatables
By Tan Lee Published on May 28, 2024 2.32K
To hide the "Showing # to # of # entries" message in jQuery DataTables, you can use CSS to hide the element containing this information.
How to kill process by name in C#
By Tan Lee Published on Oct 10, 2024 767
To kill a process by name in C#, you can use the System.Diagnostics namespace, which provides the Process class.
How to convert a dictionary to a list in C#
By Tan Lee Published on Dec 20, 2024 2.04K
In C#, dictionaries are commonly used to store key-value pairs, but sometimes, you might want to work with a list of these pairs instead of a dictionary.
C# Convert a list to a dictionary
By Tan Lee Published on Jan 21, 2025 342
The easiest way to convert a list into a dictionary is by using the LINQ ToDictionary() method.
How to set json serializer settings in ASP.NET Core
By Tan Lee Published on Dec 27, 2024 500
In ASP.NET Core, you can configure JSON serializer settings for your application in a few different ways, typically through the Startup.cs or Program.cs file.