Bind a Dataset to a Listbox using OleDbDataAdapter

Need to bind a web control to an OleDb data source in your C# web application, here’s the magic. In this case I am binding a ListBox control with an ID of ListBox1 to the ProductName field in the Products table of our old friend the Northwind database. These are...

Programatically building an HTML table in C#

These are the minimum using directives to add at the top of the code behind for building an HTML table from a SQL Server to a SqlDataReader concisely. [codesyntax lang=”csharp”] using System.Web.UI.HtmlControls; using System.Data; using...

Databound DropDownList in C#

Remember to add the usual using directives at the start of the codebehind [codesyntax lang=”csharp”] using System.Data; using System.Data.SqlClient; [/codesyntax] For a DropDownList on your ASP.NET page with an ID of Category such a [codesyntax...