Hi
I am getting error - Cannot convert from string[] to System.Exception
var errors = query.ToArray(); ExceptionLogging.SendExcepToDB(errors);
public static void SendExcepToDB(Exception exdb) { connecttion(); exepurl = HttpContext.Current.Request.Url.ToString(); SqlCommand com = new SqlCommand("ExceptionLoggingToDataBase", con); com.CommandType = CommandType.StoredProcedure; com.Parameters.AddWithValue("@ExceptionMsg", exdb.Message.ToString()); com.Parameters.AddWithValue("@ExceptionType", exdb.GetType().Name.ToString()); com.Parameters.AddWithValue("@ExceptionURL", exepurl); com.Parameters.AddWithValue("@ExceptionSource", exdb.StackTrace.ToString()); com.ExecuteNonQuery(); }
Thanks