Category: C#

  • Producer/consumer queues in C#

    What is a producer/consumer queue In a restaurant there are chefs in the kitchen who wait for orders from customers. As soon as a customer orders something, they (the chefs) make it and serve it to them (the customer). A producer/consumer queue is the same. There are workers who wait for a “job” to be…

  • C# and SQL Server

    In this article, I will discuss how to communicate with SQL Server using C#. You can use this code for communicating with other databases too but the connection string may vary. SQL Server supports SQL queries and stored procedure, and we will take a look at how to run both of them. I will assume that…

  • Scrolling a datagrid to a specific row (or to the bottom)

    There are 2 ways you can do this. In the first method, you can derive a class from datagrid and use the protected method GetVScroll(). In the second method, you can just do this : [csharp]this.dataGridView1.CurrentCell = this.dataGridView1[0, rowIndex];[/csharp] If you want to scroll to the bottom then do this : [csharp]this.dataGridView1.CurrentCell = this.dataGridView1[0, this.dataGridView.Rows.count…