Server‑Side Port Listening

Build the server‑side program, bind an IP address and port via TcpListener, start port listening and wait for incoming TCP connections from clients. Two implementation versions are provided: Console Application …

Overview

1. What is Socket Programming Analogy: Electrical outlet = network endpoint; plug = remote host; plugging in = establishing a network connection. To help you grasp these concepts, we will …

Stored Procedure Return

This section demonstrates calling stored procedures with ADO.NET: using ExecuteNonQuery to get the number of affected rows while capturing the stored procedure Return return value 1. Database Stored Procedure Definition …

SqlDataAdapter

C# ADO.NET Call Stored Procedure to Populate DataSet with SqlDataAdapter In the previous section we used SqlDataReader for forward‑only, read‑only streaming access. This section covers SqlDataAdapter, which loads stored procedure …

SqlDataReader

C# ADO.NET Call Stored Procedures with SqlDataReader Call SQL Server stored procedures and stream‑query results using SqlDataReader, key takeaways: Stored Procedure Definition You need to create the stored procedure in …

SqlTransaction database transactions

Transaction: A set of SQL operations that execute atomically. Either all operations get committed (Commit), or everything rolls back on failure (Rollback), complying with the ACID properties.Within .NET Framework/.NET, use …

ExecuteNonQuery

1. Method Overview SqlCommand.ExecuteNonQuery() Applicable Scenarios: INSERT (Create), UPDATE (Modify), DELETE (Remove). Do NOT use it for SELECT queriesReturn Value: int type, representing the number of rows affected after SQL …

CommandTimeout

What It Means CommandTimeout: command‑execution timeout, measured in seconds Full Working Example Important Notes Concise Object‑Initializer Style Connection Timeout Configuration Defined in connection string, completely independent from CommandTimeout: Connect Timeout=15 …

SqlCommand

Introduction to SqlCommand SqlCommand encapsulates the SQL statements you want to execute. Using an established database connection, it sends instructions to the database and retrieves execution results.The constructor accepts two …

Introduction and Connections

Introduction ADO.NET is the collective term for database‑related modules under the .NET platform.It lets us work with databases to perform basic CRUD operations. We can also run SQL statements, invoke …

Introduction to NVelocity

A template engine for the .NET platform, ported from Velocity on the Java platform. Introduction Widely adopted within ASP.NET projects;ASP.NET MVC ships with the Razor template engine; Many developers turn …