How To
How to Get inserted identity value with Dapper in C#
By Tan Lee Published on Mar 10, 2025 523
When inserting a record into a table that has an identity column, the database automatically generates a value for that column. To retrieve the identity value after the insert, you can use the OUTPUT INSERTED.<identity column name> clause in your SQL query.
How to add class to tr using jQuery datatable
By Tan Lee Published on May 16, 2024 2.41K
To add a class name to a DataTable using jQuery, you can use the className option when initializing the DataTable or you can add classes dynamically after the table has been initialized.
Dictionary with multiple values per key in C#
By Tan Lee Published on Dec 20, 2024 4.23K
Each dictionary key in C# maps to exactly one value. However, if you need to store multiple values for a single key, you can use a dictionary of lists.
How to delete a Windows service in PowerShell
By Tan Lee Published on Nov 05, 2024 921
To delete a Windows service using PowerShell, you'll need to stop the service and then remove it from the system.
How to use reflection to get properties in C#
By Tan Lee Published on Feb 04, 2025 1.03K
In C#, you can use reflection to inspect the properties of a class at runtime. Reflection allows you to obtain metadata about types, methods, properties, fields, etc., without knowing them at compile-time.
How to copy data to clipboard in C#
By Tan Lee Published on Dec 05, 2024 1.51K
To copy data to the clipboard in C#, you can use the Clipboard class from the System.Windows.Forms or System.Windows namespaces.
HttpClient Retry with .NET Core, Polly, and IHttpClientFactory
By Tan Lee Published on Jan 09, 2025 645
Many HTTP errors are temporary and caused by issues such as server overload, network timeouts, or transient glitches.
How to get data attribute value for selected option
By Tan Lee Published on May 31, 2024 8.69K
To get the value of a data attribute for the selected option in a dropdown using jQuery, you can use the data() method along with the :selected selector.
How to get the status code using HttpClient in C#
By Tan Lee Published on Jan 21, 2025 1.09K
When working with HttpClient in C#, it's important to handle the response status codes to ensure that your application behaves as expected.
Reading Emails Using IMAP and MailSystem.NET in C#
By Tan Lee Published on Jan 15, 2025 1.17K
In this article, we will explore how to use C# along with the MailSystem.NET library to read emails from any IMAP-enabled mail server, including Gmail.
How to get the index of an element in C# LINQ
By Tan Lee Published on Oct 29, 2024 766
In C#, you can use LINQ to find the index of an element in a list by utilizing the Select method.
How to update UI from another thread in C#
By Tan Lee Published on Dec 21, 2024 3.25K
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.