Database Sample Code
-
Health Monitoring in ASP.NET 2
by
This is a code sample for using health monitoring...
-
SQL Data Provider VB.NET Class
by
This class includes some useful methods for working with Misrosoft SQL Server in .NET simply and quickly.
-
Bulk Insert from Flat File Using Transact-SQL
by M M Harinath
Importing Data from Text File using Transact-SQL is not a tough task, we can import data from Flat File in just 3 steps.
-
Transactions made easy with .NET 2.0
by Xavier Larrea
One of the more significant improvement in .NET 2.0 is the transactions area. Now with a single line it becomes extremely easy to support transactional code blocks using the concept of “ambient” transaction thanks to TransactionScope in the System.Transactions namespace.
-
Database Independent ADO.NET 2.0
by Xavier Larrea
ADO.NET 2 has new classes that makes it quite easy to write data-programs independent of the database engine. Learn how here.
-
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!
-
Using ASHX files to retrieve DB images
by Harry Pierson
Learn how to use the little-known Http Handler functionality of ASP.NET to serve images from a database.
-
Randomly Sorting Records
by James Crowley
Here's now to randomly sort records in SQL Server 2000 - so you can potentially select say 10 random items from a table.
-
Calculate Diskspace Used by a Table or Database
by James Crowley
This short snippet shows how to discover how large a particular table or an entire database is in SQL Server.
-
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.
-
Debug ASP.NET pages using Tracing
by Julian Roberts
Demonstrates a useful debugging technique taking advantage of traces in ASP.NET.
-
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.
-
RSS Feed Helper Class
by James Crowley
A simple helper class to make generating an RSS feed a piece of cake - its the one we use on Developer Fusion too!
-
How to access a MySQL database with .NET
by Edward Tanguay
Demonstrates how to connect to a MySQL database with C#.
-
Databinding SqlTypes
by Dan Glass
Demonstrates how Databind the SqlTypes using the PropertyDescriptor class and the ITypedList Interface.
-
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.
-
ADO Utility Class
by NeverMalchik
ADO class containing useful functions - counting records, creating database from scratch, openning/closing database, filling listbox/combo box with an sql statements, manipulating records....and much more.
-
"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.
-
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.