public static APIServiceProviderNamespace.main.execlogDataTable GetLastExecLog(int projectid) { try { InitConnection(); execlogTableAdapter adapter = new execlogTableAdapter(); if (adapter.Connection != null) adapter.Connection.Close(); adapter.Connection = sqlCon; return adapter.sp_GetLastExecLog(projectid); } catch (Exception exObj) { lastErrorString = exObj.Message; string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase); System.IO.File.AppendAllText(path.Replace("file:\\", "") + "\\dblog.txt", "[GetLastExecLog - " + DateTime.Now.ToString() + "]" + exObj.Message + "\r\n"); } return null; }