public static bool LoadCallstack(int callstack_uid, ForEachSinglestep func) { using (SqlConnection conn = new SqlConnection(connectionString)) { try { conn.Open(); SqlCommand cmd1 = new SqlCommand("usp_select_callstack_by_callstack_uid", conn); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@callstack_uid", callstack_uid); SqlDataReader reader = cmd1.ExecuteReader(); while (reader.Read()) { int depth = reader.GetInt16(0); string funcname = reader.GetString(1); string fileline = reader.GetString(2); func(depth, funcname, fileline); } reader.Close(); } catch (System.Exception) { return(false); } } return(true); }
public static bool LoadCallstack(int callstack_uid, ForEachSinglestep func) { using (SqlConnection conn = new SqlConnection(connectionString)) { try { conn.Open(); SqlCommand cmd1 = new SqlCommand("usp_select_callstack_by_callstack_uid", conn); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@callstack_uid", callstack_uid); SqlDataReader reader = cmd1.ExecuteReader(); while (reader.Read()) { int depth = reader.GetInt16(0); string funcname = reader.GetString(1); string fileline = reader.GetString(2); func(depth, funcname, fileline); } reader.Close(); } catch (System.Exception) { return false; } } return true; }