Articles tagged #C#
9 article(s)
-
Run MongoDB in Docker and Connect from .NET
Skip the MongoDB installer — one docker run gives you a working database. From there the .NET driver takes over: documents, queries, atomic updates, transactions, and the small traps that catch you on the first try.
@llaxmikant · May 26, 2026 -
How to Export SQL Server Data to Excel in C# (Without Office Interop)
Export SQL Server query results to Excel with ClosedXML — no Office installation, no COM Interop, safe on servers and containers, with styling and a Web API download endpoint.
@llaxmikant · Mar 21, 2026 -
How to Setup CORS Policies in ASP.NET Core Web API
Configure CORS in ASP.NET Core Web API — default and named policies, origin/method/header restrictions, preflight requests, per-endpoint policies with RequireCors, and EnableCors/DisableCors attribute
@llaxmikant · Mar 2, 2026 -
Bulk Upload into SQL Server using SqlBulkCopy and C#
Load 100,000 rows in under a second with SqlBulkCopy: column mappings, batch sizes, transactions, staging tables, and the constraint fine print — measured for real.
@llaxmikant · Feb 28, 2026 -
Compare DataTables with LINQ: Except, Intersect and Union
To compare two ADO.NET DataTable objects, call AsEnumerable() on each to get a sequence of DataRow, then apply LINQ set operators: Except gives rows in the…
@llaxmikant · Jan 1, 2026 -
IDisposable, Finalizers and the Dispose Pattern in .NET
Deterministic cleanup in .NET means releasing a resource the moment you are done with it, instead of waiting for the garbage collector. You get it by…
@llaxmikant · Dec 20, 2025 -
.NET Dependency Injection Object Lifetimes
The built-in .NET dependency injection container ships three service lifetimes: Transient (a new instance on every resolution), Scoped (one instance per…
@llaxmikant · Dec 14, 2025 -
Convert a DataTable to CSV, List or JSON in .NET
To convert an ADO.NET DataTable to CSV, a strongly-typed List<T, or a JSON string in .NET 9, iterate the table's columns and rows with a StringBuilder for…
@llaxmikant · Nov 19, 2025 -
How to Implement Dependency Injection in .NET Core
To implement dependency injection in .NET Core, register your services in the built-in container (IServiceCollection) with a lifetime, then declare each…
@llaxmikant · Sep 1, 2025