Database Sample Code
-
Encrypting Web.config sections in ASP.NET 2.0
by Xavier Larrea
Learn how to encrypt any section of your Web.config file on-the-fly and programatically; plain-text connection strings in your config file are no more!
-
Deleting duplicate rows in a table
by Kevin Saitta
Eliminating duplicate rows of data from an Oracle database
-
How to access a MySQL database with .NET
by Edward Tanguay
Demonstrates how to connect to a MySQL database with C#.
-
"On Error Resume Next" considered harmful
by Palo Mraz
Discusses some unexpected implications of using the 'On Error Resume Next' statement in Visual Basic applications.
-
Storing / Retrieving pictures from database
by Imthiaz Rafiq
This sample code demonstrates how to save and retrieve pictures from a database using PHP.
-
Display SQL Server table data in a browser
by Edward Tanguay
Just supply your database connection string and this code will give you a radio button list of all your SQL Server tables and will show their fields.
-
How to delete records with SqlCommand
by Edward Tanguay
This code shows you how to delete records with an SQL statement and get the number of records deleted returned back as an integer.
-
Running total in an SQL query
by James Crowley
How to create a running total column in an SQL query
-
Create Table in a Database
by amoibade
This code shows you how to create a table and it's indexes in a database at run time.
-
Get metadata on MySQL databases
by Edward Tanguay
An example of how to get metadata - such as all the databases on the server, all of their tables, and the corresponding field information for that table.
-
Evaluate string formulas in VB
by ElementK Journals
How to evaluate string formulas in VB
-
Debug ASP.NET pages using Tracing
by Julian Roberts
Demonstrates a useful debugging technique taking advantage of traces in ASP.NET.
-
Limit the number of rows returned
by Alt-PHP-Faq
How to limit the number of records returned from a MySQL database
-
Access AutoNumber Reset
by Michael Gagne
This is some sample code that shows how to programmatically reset all AutoNumber fields in an Access Database to a correct value (whether it be 0 or the max value + 1). In addition, it contains code for Compacting and Repairing an MS Access Database. This is perfect for people who are working with a complicated Access Database and have experienced AutoNumber bugs!
-
Resizing images retrieved from SQL server
by Simon Soanes
A neat way of fetching an image stored in SQL Server and resizing it before save/sending it anywhere.
-
Access, VB and SQL Server wildcard characters
by James Crowley
Important differences between Access, VB and SQL Server wildcard characters
-
How to run through multiple DataReader results
by Edward Tanguay
You can save code by piling SQL statements into one SqlCommand and then getting a DataReader with multiple result sets.
-
How to include Text, nText and Image datatypes in a Union query
by ElementK Journals
How to include Text, nText and Image datatypes in a Union query
-
Getting Started with Database Programming
by gigsv00
This is a conceptual idea of how I start to do database programming. In this article, I had highlighted a few points that become vital to understand for any new comers to do database programming.
-
Update MSMQ from SQL
by Bruce Johnson
Describes how to post a message into MSMQ from within a SQL procedure