在ado.net中使用datetimepicker控件绑定数据 [英] binding data with datetimepicker control in ado.net

查看:91
本文介绍了在ado.net中使用datetimepicker控件绑定数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生
我想在Windows窗体应用程序中将日期列与日期时间选择器绑定.

Dear sir
I want to bind a date column with a datetime picker in windows forms application.
how i can do that!

推荐答案

嗨.

以上可以通过以下代码实现.这会将您的日期值(在下面的示例中为当前日期/时间)分配给相关控件.

请注意,不会显示DateTime的时间方面.

Hi.

The above can be achieved by the following code. This will assign your date value (in the example below, the current date / time) to the control in question.

Please note that the time aspect of the DateTime would not be displayed.

DateTime MyDateTime = DateTime.Now()
DateControl.Value = MyDateTime();


这篇关于在ado.net中使用datetimepicker控件绑定数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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