static void RegistrarError(Exception error)
{
System.IO.StreamWriter w = System.IO.File.AppendText ("DBNet.log");
w.Write ("\r\nRegistro de error: ");
w.WriteLine ("{0} {1}", DateTime.Now.ToShortDateString (), DateTime.Now.ToShortTimeString ());
w.WriteLine ("Message: {0}", error.Message);
w.WriteLine ("Source: {0}", error.Source);
w.WriteLine ("StackTrace:");
w.WriteLine (error.StackTrace);
w.WriteLine ("-------------------------------");
w.Flush ();
w.Close ();
}