ta mu

ta mu

  • NA
  • 201
  • 82.2k

textbox value

Aug 11 2013 12:58 AM
 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();

  }



Answers (8)