How To
How to change the buffer size of StreamWriter in C#
By Tan Lee Published on Dec 26, 2024 1.29K
StreamWriter buffers data by writing it to an internal character array, which has a default size of 1024 bytes and a minimum size of 128 bytes. Once the buffer is full, or when the StreamWriter is disposed, the buffer is flushed to the underlying stream.
How to find index of item in array in C#
By Tan Lee Published on Oct 25, 2024 1.16K
To find the index of an item in an array in C#, you can use Array.IndexOf or Array.FindIndex method.
Download backup of Northwind database for SQL Server
By Tan Lee Published on Nov 13, 2024 695
To get the Northwind sample database for SQL Server, you can follow one of the steps below.
How to get connectionstring from appsettings.json instead of being hardcoded in .NET Core
By Tan Lee Published on Nov 01, 2024 1.39K
In .NET Core, it's a good practice to store your connection strings in the appsettings.json file instead of hardcoding them in your code.
How to get index of element in array C# LINQ
By Tan Lee Published on Oct 25, 2024 564
To get the index of an element in an array using LINQ in C#, you can use the Select method along with Where to find the index.
How to start, stop and verify if a service exists in C#
By Tan Lee Published on Jul 01, 2024 1.54K
To interact with services in C#, you typically use the ServiceController class from the System.ServiceProcess namespace.
How to Convert an Object to a Byte Array in C#
By Tan Lee Published on Oct 28, 2024 4.35K
To convert an object to a byte array in C#, you can use serialization.
How to validate an IP address in C#
By Tan Lee Published on Dec 24, 2024 1.14K
In .NET, the System.Net.IPAddress class provides convenient methods for working with IP addresses, specifically Parse() and TryParse().
How to fix 'AngularJs minify Error: [$injector:unpr]'
By Tan Lee Published on Feb 16, 2024 422
The [$injector:unpr] error in AngularJS typically occurs when a dependency is missing, misconfigured, or not properly injected into a controller, service, or factory.
How To Implement Toaster In AngularJS
By Tan Lee Published on Feb 16, 2024 428
To implement a toaster in AngularJS, you can either use a third-party library.
How to fix 'The transaction log for the database is full due to ACTIVE_TRANSACTION'
By Tan Lee Published on Feb 16, 2024 1.19K
The error "The transaction log for database 'x' is full due to 'ACTIVE_TRANSACTION'" in SQL Server usually occurs when the transaction log file grows too large and doesn't have enough space for ongoing transactions.
How to use ROW_NUMBER Function in SQL Server
By Tan Lee Published on Feb 16, 2024 564
The ROW_NUMBER() function in SQL Server is used to assign a unique sequential integer to rows within a result set.