如何让datetimepicker来控制datagrid?

时间:2016-04-18 13:54:39

标签: vb.net

所以这是我的代码,我试图在数据库mdf上创建datetimepicker来控制我的数据网格。在。

下也有查询代码
func addUnitToDate(unitType: NSCalendarUnit, number: Int, date:NSDate) -> NSDate {

    return NSCalendar.currentCalendar().dateByAddingUnit(
        unitType,
        value: number,
        toDate: date,
        options: NSCalendarOptions(rawValue: 0))!

}

print( addUnitToDate(.Day, number: 1, date: NSDate()) ) // Adds 1 Day To Current Date
print( addUnitToDate(.Hour, number: 1, date: NSDate()) ) // Adds 1 Hour To Current Date
print( addUnitToDate(.Minute, number: 1, date: NSDate()) ) // Adds 1 Minute To Current Date

// NOTE: You can use negative values to get backward values too
Private Sub Date_JoinedDateTimePicker_ValueChanged(sender As Object, e As EventArgs) Handles Date_JoinedDateTimePicker.ValueChanged
    Me.MembersTableAdapter.FillBy(Me.KarateDataSet.Members, Date_JoinedDateTimePicker.Value )
End Sub

0 个答案:

没有答案