Microsoft created a class for exactly this purpose, named SqlHelper. The source code is here...
http://www.koders.com/csharp/fidD4121D6E4BCA2DAB656D770903FECBFF7427D242.aspx[
^]
You don't have to keep creating SQL Connections with this class, you can just send it your connection string to one of the overloads. e.g.
string connectionString = "Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;"
System.Data.DataSet results = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(connectionString, System.Data.CommandType.Text, "SELECT Field1 FROM Table5");
int someParameter1 = 5;
string someParameter2 = "Test";
using (var reader = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader(connectionString, "MyStoredProcedureName", someParameter1, someParameter2))
{
while (reader.Read())
{
}
}