0

我有两个 Windows 窗体。一个是Insert new member,另一个是Edit member

插入新成员时,我可以选择Membership Date. 我想将所选内容Membership Date放入Edit member表单中,其中我有一个datetimepicker.

示例:我创建了一个新成员,其 IDA-15和成员资格日期为15/05/2013。当我想编辑这个成员时,我会Membership IDEdit 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], );
4

1 回答 1

0

you need to get membership date value from the datatable and set it as selected date of datetimepicker

DateTime membershipdate = YourDataTable.Row[0].Field<DateTime>("MEMBERSHIP_DATE");
datetimepicker.Value= membershipdate;
于 2013-07-04T03:05:18.500 回答