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
81.8k
monther calander value from database
Sep 15 2013 7:29 AM
i am using this code to get stored values of different controls from database. others are ok but monthcalander and datatime picker dont get values from database. i inserted these values using
SqlCommand cmd = new SqlCommand ("INSERT INTO reminder (message,date,time) VALUES ('" + textBox1.Text + "','" + monthCalendar1.SelectionStart + "','" + dateTimePicker1.Value + "')", my);
and try to get with this code. no error but why not both controls getting there values.
my.Open();
string cellvalue = dataGridView1["id", index].Value.ToString();
SqlCommand cmd = new SqlCommand("SELECT * FROM reminder WHERE id='" + cellvalue + "'", my);
SqlDataReader rd = cmd.ExecuteReader();
rd.Read();
upr.textBox1.Text = rd["message"].ToString();
upr.monthCalendar1.SelectionStart =System.Convert.ToDateTime(rd["date"]);
upr.label1.Text = rd["id"].ToString();
upr.dateTimePicker1.Value = System.Convert.ToDateTime(rd["date"]);
my.Close();
Reply
Answers (
2
)
Array.Sort() and Sort()
Read CSV text file