Select Page

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...

Populate a DropDownList with the names of installed fonts with C#

Need to get a list of available fonts for your application?, this little gem will retrieve the font names of all installed fonts on your server (asp.net) and use them to populate a DropDownList. These are the namesspaces you need to import to get this running....

Binding a GridView in C# with a parameterized command

With two controls on your asp.net page a DropDownList (ID ddlDropDownList) and a GridView (ID gvGridView), to retrieve the SelectedValue from the DropDownList and use that in the where clause of the query used to bind data to your GridView the following will help....

Databinding a GridView in C# with ADO.NET

Something simple, you want to use ADO.NET to bind data from SQL Server to a GridView, here is your code behind [codesyntax lang=”csharp”] using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using...

How to store and retrieve information using web.config

So you like the idea of storing variables centrally, and want to know how to implement that in your c# web site. Simply add the following node to your web.config if it does not already exist [codesyntax lang=”xml”] <configuration> <appSettings>...