Skip to content

C# Examples

  • Home
  • About C#
    • C# Interview Questions and Answers for .NET Developers
    • Learn C#: A Practical Path Through the Examples
  • All Posts
  • Bootstrap 5 Examples
  • Contact

C# .NET

C# Stack Example: Last-In, First-Out Collections

November 25, 2026March 27, 2019 by turgay

How to push, pop and peek with the generic Stack in C#, avoid the empty-stack exception with TryPop, and use a stack to check balanced brackets.

Categories C# .NET, Collections Tags collections, stack Leave a comment

C# Queue Example: First-In, First-Out Collections

November 25, 2026March 27, 2019 by turgay

How to enqueue, dequeue and peek with the generic Queue in C#, when to use PriorityQueue or ConcurrentQueue instead, and how the legacy Queue class differs.

Categories C# .NET, Collections Tags collections, Queue Leave a comment

C# Hashtable vs Dictionary: Key-Value Examples

November 25, 2026March 27, 2019 by turgay

Store and look up key-value pairs with the generic Dictionary in C#, and what to know about the legacy Hashtable when you maintain older code.

Categories C# .NET, Collections Tags collections, hashtable Leave a comment

Select, Insert, Update and Delete Data in MySQL with C#

November 25, 2026June 1, 2015 by turgay

Async CRUD against MySQL from C# with MySqlConnector: parameterised queries, reading rows, getting the new ID and using a transaction.

Categories C# .NET, Databases, MySQL Tags C#, c# mysql insert, c# mysql select, database, delete, insert, mysql, select, update 2 Comments

Get the Width and Height of Any Window in C# with GetWindowRect

November 25, 2026October 10, 2014 by turgay

Read the position and size of any window, including other applications’ windows, with the GetWindowRect API in C#, plus the DPI and border traps.

Categories C# .NET, WinForms Tags C#, get window rectangle, windows api Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page17 Next →

Categories

Recent Posts

  • Select XML Nodes by Name or Attribute Value in C#
  • Binary Search Tree in C#: Add, Find, Remove and Traversals
  • Select, Insert, Update and Delete Data in an Access File with C#
  • C# Collections: Which One to Use and When
  • C# ArrayList vs Generic List: Examples and When to Use Each
  • About
  • Privacy Policy
  • Contact
© 2026 C# Examples