public static bool DeleteCampaignStatisticsRecords(int projectid, DateTime dt, string cid, string provider) { try { InitConnection(); campaignstatsTableAdapter adapter = new campaignstatsTableAdapter(); if (adapter.Connection != null) adapter.Connection.Close(); adapter.Connection = sqlCon; adapter.sp_DeleteCampaignStatisticsRecords(projectid, dt, cid, provider); return true; } catch (Exception exObj) { lastErrorString = exObj.Message; string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[DeleteCampaignStatisticsRecord - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n"); } return false; }