Posts

Showing posts from August, 2015

How do you detect if your browser is online?

Answer :) window.navigator.onLine

Generate SqlException with your preferred error code

A quick and dirty way of generating SqlException class SqlExceptionGenerator     {         public static void ThrowException(SqlConnection con)         {             con.Open(); // should be a valid connection             SqlCommand cmd = new SqlCommand("raiserror(50005, 16, 1)", con);             cmd.ExecuteNonQuery();         }     }