我有两个Windows窗体。一个是Insert new member
,另一个是Edit member
。
插入新会员时,我可以选择Membership Date
。我希望将选定的Membership Date
转换为Edit member
表单,其中我有datetimepicker
。
示例:我创建了一个ID A-15
且成员日期为15/05/2013
的新成员。当我想编辑此成员时,我会将Membership ID
键入Edit member
表单并运行该程序。这会将所有详细信息加载到文本框中,将Membership Date
加载到datetimepicker
。
我遇到了datetimepicker
的问题。如何从datetimepicker
表格中的信息中选择日期并在MySQL
中显示日期?
代码:
CREATE TABLE [DBO].[DONORINFO] ( [MEMBERSHIP_NO] [VARCHAR](10) PRIMARY KEY NOT NULL,
[NAME_STATE] [VARCHAR](10) NULL, [FULL_NAME] [VARCHAR](100) NULL, [STREET_NO] [VARCHAR]
(50) NULL, [STREET] [VARCHAR] (50) NULL, [CITY] [VARCHAR] (50) NULL, [TEL] [VARCHAR]
(50) NULL, [EMAIL] [VARCHAR] (50) NULL, [DIOCESE] [VARCHAR] (50) NULL, [CUS_TYPE]
[VARCHAR] (50) NULL, [MEMBERSHIP_DATE] [DATE], );
答案 0 :(得分:0)
您需要获得会员资格date value from the datatable
并将其设置为datetimepicker
DateTime membershipdate = YourDataTable.Row[0].Field<DateTime>("MEMBERSHIP_DATE");
datetimepicker.Value= membershipdate;