foxtable 代码
Dim dt As DataTable = Functions.Execute("生成cmd数据表","打卡数据","")
dt.StopRedraw() '停止绘制
Dim nms1() As String
nms1 = New String() {"姓名","身份证号码","时间"}
Dim r As DataRow = dt.AddNew()
Dim mm As Integer = 1
For m1 As Integer = 0 To nms1.Length - 1
Dim ss1 As String = nms1(m1)
If dt.DataCols(ss1).IsDate Then '如果是日期类型的列
r(ss1)= ary(n + 1,mm)
Else
r(ss1) = ary(n + 1,mm)
End If
mm = mm + 1
Next
r.save()
修改成 sql 代码,怎么改, 时间判断的地方怎么加,求助
Dim cmdadd As new SQLCommand
cmdadd.C
cmdadd.CommandText = "Insert Into 打卡数据 (姓名,身份证号码,时间) Values(?,?,?)"
For m1 As Integer = 0 To nms1.Length - 1
Dim ss1 As String = nms1(m1)
If dt.DataCols(ss1).IsDate Then '如果是日期类型的列
cmdadd.Parameters.Add("@" & ss1,ary(n + 1,mm))
Else
cmdadd.Parameters.Add("@" & ss1,ary(n + 1,mm))
End If
mm = mm + 1
Next
cmdadd.ExecuteNonQuery