using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; using System.Data.Sql; using System.Data.SqlClient; using System.Text; using System.IO; using System.Web; using System.Net; /// <summary> /// Summary description for dbLayer /// </summary> public class dbLayer { private string gConnString; public dbLayer(string strConnn) { gConnString = strConnn; } public void WebConfig_ActivityLog(string username, string activity) { SqlConnection sqlConn = new SqlConnection(); SqlCommand sqlCmd = new SqlCommand(); sqlConn.ConnectionString = gConnString; sqlCmd.CommandText = "dbo.[sp_Activity_Trail]"; sqlCmd.CommandType = CommandType.StoredProcedure; sqlCmd.Connection = sqlConn; sqlCmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@username", SqlDbType.VarChar, 255)); sqlCmd.Parameters.Add(new System.Data.SqlClient.SqlParameter("@activity", SqlDbType.VarChar, 4000)); sqlCmd.Parameters["@username"].Value = username; sqlCmd.Parameters["@activity"].Value = activity; try { sqlConn.Open(); sqlCmd.ExecuteNonQuery(); } catch (Exception objExp) { throw objExp; } finally { if (sqlConn != null && sqlConn.State != System.Data.ConnectionState.Closed) { sqlConn.Close(); } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)