An object reference is required for the non-static field, method, or property 'login.add_reminder.textBox1'
i am getting this error. textbox is on other form. access modifire is public but still error. how to resolve this error.
private void ok_Click(object sender, EventArgs e)
{
SqlConnection my = new SqlConnection(@"Data Source=heaven_prince20;Initial Catalog=final_pr;Integrated Security=True");
my.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO reminder(messaq,date,time) VALUES ('" + add_reminder.textBox1.Text + "''" + monthCalendar1.SelectionRange.Start + "','" + dateTimePicker1.Value + "')", my);
cmd.ExecuteNonQuery();
}
Loading
Iftikar HussainPosted Aug 11, 2013, 1:23 AM
Regards,
Iftikar
ta muPosted Aug 11, 2013, 3:08 AM
Iftikar HussainPosted Aug 11, 2013, 3:02 AM
Regards,
Iftikar
ta muPosted Aug 11, 2013, 2:12 AM
whats wrong
ta muPosted Aug 11, 2013, 1:18 AM
Iftikar HussainPosted Aug 11, 2013, 1:08 AM
Regards,
Iftikar
ta muPosted Aug 11, 2013, 1:04 AM
Iftikar HussainPosted Aug 11, 2013, 1:03 AM
What is add_reminder? Have you created the instance of this form?
Regards,
Iftikar