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
Tushar Goel
NA
26
0
Unable to use date through textbox
Feb 13 2011 4:37 AM
Hi,
I need to display the gridview depends upon the date. For this , i used 2 Textbox which take date as an input from the user. Everything works good except the date part. When i am passing the value through textbox, sql query is not working. Any suggestion?
I am using following query :
protected
void
Calendar1_SelectionChanged(
object
sender,
EventArgs
e)
{
TextBox1.Text = Calendar1.SelectedDate.ToString();
}
protected
void
Calendar2_SelectionChanged(
object
sender,
EventArgs
e)
{
TextBox2.Text = Calendar2.SelectedDate.ToString();
}
SqlCommand
cmd =
new
SqlCommand
(
"select * where ID
.EventStartTime between '"
+ TextBox1.Text +
"' and '"
+ TextBox2.Text +
"' order by ID.EventStartTime desc"
, con);
con.Open();
SqlDataReader
read = cmd.ExecuteReader();
GridView1.DataSource = read;
GridView1.DataBind();
con.Close();
Regards
Tushar Goel
Reply
Answers (
1
)
Sum score from database table
how to create two chart in same chart area.