private void button2_Click(object sender, EventArgs e)
{
try
{
if (richTextBox1.Text != "")
{
SqlConnection con = new SqlConnection("DATA SOURCE =(Local);INITIAL CATALOG =GutModas;USER ID=;PASSWORD=;Integrated Security=SSPI;");
con.Open();
SqlCommand com = new SqlCommand("INSERT INTO Recordatorios (Recordatorio,fecha) VALUES ('" + richTextBox1.Text + "','" + dateTimePicker1.Value.Day + "/" + dateTimePicker1.Value.Month + "/" + dateTimePicker1.Value.Year + "')", con);
com.ExecuteNonQuery();
con.Close();
richTextBox1.Text = "";
MessageBox.Show("Recordatorio Grabado", "Mensaje");
}
else
MessageBox.Show("Debe Ingresar el Mensaje", "Alerta");
}
catch { }
}