TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
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();
}
Reply
Answers (
8
)
Calling a method without first calling constructor
C# Update DataSet tables