sql server 的外部数据源,按钮代码如下:
Dim Date_S As WinForm.DateTimePicker = e.Form.Controls("date_E")
Dim Date_E As WinForm.DateTimePicker = e.Form.Controls("date_S")
Dim cmd As New SQLCommand
cmd.ConnectionName = Mydata
If Date_S.Value IsNot Nothing AndAlso Date_S.Value IsNot Nothing Then
Dim count As Integer
cmd.CommandText = "DELETE FROM {Log} WHERE 修改时间 >= '" & Date_S.value & "' And 修改时间 <= '" & Date_E.value & "'"
count = cmd.ExecuteNonQuery()
Messagebox.Show( "总共删除" & Count & "行!")
End If
里面有数据,但每次执行都是显示删除了0行,也没什么提示。
控件中的日期显示是 2013-10-22
而sql数据库表中的日期是2013/11/8 14:48:03
是不是这两种格式不能比较?
谢谢!
[此贴子已经被作者于2013-11-9 11:53:49编辑过]