Nice try and very interesting topic you can use code:
Code:
Using System.Data.SqlClient;
using System.Collections.Specialized;
using System.Text;

Here’s the code block for deleting multiple records

#region Multiple Delete
private void DeleteRecords(StringCollection sc)
{
   SqlConnection conn = new SqlConnection(GetConnectionString());
   StringBuilder sb = new StringBuilder(string.Empty);
 
   foreach (string item in sc)
   {
     const string sqlStatement = "DELETE FROM Customers WHERE CustomerID";
     sb.AppendFormat("{0}='{1}'; ",sqlStatement, item);
   }
   try
   {
            conn.Open();
            SqlCommand cmd = new SqlCommand(sb.ToString(), conn);
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
    }
    catch (System.Data.SqlClient.SqlException ex)
    {
            string msg = "Deletion Error:";
            msg += ex.Message;
            throw new Exception(msg);
     }
     finally
     {
            conn.Close();
     }
}

Last edited by shabbir; 11Nov2012 at 10:13.. Reason: Confine Links to Signatures