在我们的项目中添加日历的Querry [英] querry for adding calender in our project

查看:110
本文介绍了在我们的项目中添加日历的Querry的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友
请告诉我在我们基于窗口的项目中添加callender,我们选择日期,例如从11 \ 11 \ 11到12 \ 12 \ 12 ...
谢谢...
From-Niraj New Delhi [INDIA]

hi friends
plz tell me to adding callender in our window based project which we pick date as like from 11\11\11 to 12\12\12...
Thanks...
From-Niraj New Delhi[INDIA]

推荐答案

如果将DateTimePicker添加到应用程序中,则可以将MinDate和MaxDate属性设置为所需的限制.用户将无法选择该范围之外的日期.


我要textbox1->选择日期,例如7 \ 12 \ 11
textbox2->选择日期1 \ 4 \ 12之后,我们就会记录这两天之间的所有emp ...
谢谢."



不要使用文本框-而是使用两个DateTimePickers-这样,用户无需任何操作即可以首选格式输入日期(因此,如果他是美国人,则日期将设置为MM/dd/yyyy,如果他是欧洲人,他的约会日期是dd/MM/yyyy.
要从数据库检索记录,只需使用以下值:
If you add a DateTimePicker to your application, you can set the MinDate and MaxDate properties to the limits you require. The user will not be able to select a date outside that range.


"i wants to textbox1->pick date like as 7\12\11
textbox2->pick date 1\4\12 after then we get record any emp between these days...
thanks.."



Don''t use text boxes - use two DateTimePickers instead - that way the user gets to enter the date in his preferred format without any work from you (so if he is American his date will be set to MM/dd/yyyy and if he is European his date will be dd/MM/yyyy).
To retrieve records from a database just use the values:
SqlCommand cmd = new SqlCommand("SELECT * FROM myTable WHERE myDate BETWEEN @START AND @END", con);
cmd.Parameters.AddWithValue("@START", dtpStartDate.Value);
cmd.Parameters.AddWithValue("@END", dtpEndDate.Value);
...


这篇关于在我们的项目中添加日历的Querry的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆