Search
How to update UI from another thread in C#
By Tan Lee Published on Dec 21, 2024 2.37K
In C#, you cannot directly update the UI from a background thread because Windows Forms and WPF (UI frameworks) require UI updates to happen on the main UI thread.
Read moreSerialize and Deserialize a Multidimensional Array in JSON using C#
By Tan Lee Published on Dec 25, 2024 1.08K
By default, System.Text.Json does not support serializing or deserializing multidimensional arrays.
Read moreHow to Search DataGridView by using TextBox in C#
By Tan Lee Published on Aug 13, 2017 27.46K
To filter or search a DataGridView using a TextBox in C#, you typically bind the DataGridView to a DataTable or similar data source and use a DataView to filter the rows.
Read moreHow to retrieve the Downloads Directory Path in C#
By Tan Lee Published on Jun 27, 2024 3.24K
In C#, you can retrieve the path to the user's Downloads directory using the Environment class and the SpecialFolder enumeration.
Read moreRetrieve a Single Row with Dapper in C#
By Tan Lee Published on Jan 18, 2025 610
When you need to retrieve a single row from a database using Dapper, the simplest approach is to use the QuerySingleOrDefault() method.
Read moreHow to Print RDLC Report without Report Viewer in C#
By Tan Lee Published on Jul 17, 2024 33.02K
To print an RDLC report without using the Report Viewer control in a C# Windows Forms application, you can follow these steps.
Read moreHow to Convert string to JSON in C#
By Tan Lee Published on Nov 19, 2024 2.41K
You can convert a string to a JSON object in C# using the `JsonSerializer.Deserialize` method from the `System.Text.Json` namespace.
Read moreHow to use decimal precision and scale in EF Code First
By Tan Lee Published on Jul 11, 2024 1.08K
In C# Entity Framework, when you want to use the Decimal data type for your entity properties, you can follow these steps.
Read moreIgnoring Namespaces in XML when Deserializing in C#
By Tan Lee Published on Jan 10, 2025 1.34K
Namespaces in XML can be tricky to handle, especially when you're working with documents that sometimes include them and sometimes do not.
Read moreHow to convert GUID to Integer in C#
By Tan Lee Published on Nov 10, 2024 736
Converting a GUID to an integer in C# isn't a straightforward process because a GUID is a 128-bit value, while an integer in C# is only 32-bits.
Read moreHow to Print DataGridView with Header and Footer in C#
By Tan Lee Published on Jul 13, 2024 8.76K
Printing a DataGridView with header and footer in C# involves several steps, including setting up the printing functionality, handling page breaks, and customizing headers and footers.
Read moreHow to consume an SSE endpoint using HttpClient in C#
By Tan Lee Published on Jan 22, 2025 482
Server-Sent Events (SSE) offer an efficient way for clients to receive real-time updates from a server.
Read moreGroup By in C# LINQ
By Tan Lee Published on Jan 20, 2025 162
In C#, LINQ's Group By is a query operator that allows you to organize elements of a sequence into groups based on a specified key selector function.
Read moreHow to Use the New Lock Object in C#
By Tan Lee Published on Jan 15, 2025 386
C# has supported thread synchronization with the `lock` keyword since its early versions, ensuring that only one thread executes a block of code at a time.
Read moreSolr Search in .NET Core
By Tan Lee Published on Jan 10, 2025 566
.NET Core offers robust support for interacting with the Solr search engine.
Read moreHandling 415 Unsupported Media Type in .NET Core API
By Tan Lee Published on Jan 10, 2025 1.12K
In .NET Core APIs, the default content type for incoming requests is application/json.
Read moreImplementing HTTP Timeout Retries with Polly and IHttpClientBuilder
By Tan Lee Published on Jan 09, 2025 544
Polly's retry functionality combined with IHttpClientBuilder provides an elegant solution to configure retry logic at the application startup.
Read moreHow to implement a distributed cache in ASP.NET Core
By Tan Lee Published on Jan 07, 2025 290
ASP.Net Core offers support for various caching techniques, including in-memory caching, response caching, and built-in distributed caching.
Read moreHow to use Tuple in C#
By Tan Lee Published on Jan 07, 2025 200
Tuples are data structures that store a fixed-size, ordered sequence of immutable, heterogeneous elements, meaning each element can be of a different type.
Read moreHow to use Lamar in ASP.NET Core
By Tan Lee Published on Jan 07, 2025 202
ASP.Net Core has built-in support for dependency injection (DI) with a minimal DI container.
Read moreHow to use Singleton pattern in C#
By Tan Lee Published on Feb 16, 2024 748
The Singleton is a creational design pattern that ensures a class has only one instance.
Read moreOverflowException: Value was either too large or too small for an int32
By Tan Lee Published on Dec 25, 2024 526
When working with integer parsing in C#, one of the most common exceptions that developers encounter is the OverflowException: Value was either too large or too small for an Int32.
Read moreHow to delete a directory in C#
By Tan Lee Published on Dec 25, 2024 414
In C#, one of the simplest ways to delete a directory is by using the Directory.Delete() method from the System.IO namespace.
Read moreSystem.BadImageFormatException: Could not load file or assembly
By Tan Lee Published on Dec 24, 2024 496
This occurs when one assembly is compiled for a 32-bit architecture (x86) and another is compiled for a 64-bit architecture (x64), and the two attempt to interact or reference each other.
Read moreObjects added to a BindingSource’s list must all be of the same type
By Tan Lee Published on Dec 21, 2024 407
When working with data binding in C#, one common scenario is binding a list of objects to a user interface control (like a DataGridView, ComboBox, or ListBox).
Read moreHow to use CORS in ASP.NET Core
By Tan Lee Published on Dec 19, 2024 500
In this article, we will explore one of the challenges users faced in the early days of web development the Same-Origin Policy (SOP) and how Cross-Origin Resource Sharing (CORS) became a solution.
Read moreHow to Run Background Tasks in ASP.NET Core with Hosted Services
By Tan Lee Published on Dec 19, 2024 413
One of the features I appreciate most about .NET Core is how easily it allows you to implement and run background tasks in an ASP.NET Core project.
Read more10 Common Mistakes ASP.NET Developers Should Avoid
By Tan Lee Published on Dec 16, 2024 431
ASP.NET Core is a powerful framework for building modern web applications, but even seasoned developers can make mistakes that impact performance, security, or maintainability.
Read moreHow to Insert Update Delete Search data from local database in C#
By Tan Lee Published on Jul 24, 2017 10.55K
Creating a Telephone Diary (Phone Book) application in C# using Material Skin with a local database can be broken down into the following steps.
Read moreHow to Generate Serial Key in C#
By Tan Lee Published on Jul 03, 2017 10.5K
Serial key generation and validation are crucial components of software licensing.
Read more