Foxtable(狐表)用户栏目专家坐堂 → 日期怎么填入SQL数据库里?


  共有2344人关注过本帖树形打印复制链接

主题:日期怎么填入SQL数据库里?

帅哥哟,离线,有人找我吗?
hongye
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:437 积分:2943 威望:0 精华:0 注册:2011/3/15 12:49:00
日期怎么填入SQL数据库里?  发帖心情 Post By:2020/3/2 11:04:00 [显示全部帖子]

.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2020.2.28.8
错误所在事件:窗口,核价系统窗口,Button3,Click
详细错误信息:
从字符串“”到类型“Date”的转换无效。
Dim dr As DataRow
dr = DataTables(fr & "订单核价系统").Find("客户 = '" & kh.Value & "'And 客户担当 = '" & kd.Value & "'And 类别 = '" & lb.Value & "'And 品名 = '" & pm.Value & "'And 款号 = '" & ks.Value & "'And 样衣款号 = '" & yk.Value & "'")
If dr("填报日期") = "" Then
    Dim drd As Date = Date.Today()
    dr("填报日期") = drd
End If


 回到顶部
帅哥哟,离线,有人找我吗?
hongye
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:437 积分:2943 威望:0 精华:0 注册:2011/3/15 12:49:00
  发帖心情 Post By:2020/3/2 12:19:00 [显示全部帖子]

Dim kh As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Dim ht As WinForm.ComboBox = e.Form.Controls("ComboBox3")
Dim ks As WinForm.ComboBox = e.Form.Controls("ComboBox2")
Dim dd As WinForm.ComboBox = e.Form.Controls("ComboBox4")
Dim rq As WinForm.ComboBox = e.Form.Controls("ComboBox5")
If dd.text = ""
    If ks.Text = ""
        If kh.Text = ""
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","样衣款号 = '" & ht.Text & "'","填报日期")
            End If
        Else
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","客户 = '" & kh.Text & "'","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","样衣款号 = '" & ht.Text & "'and 客户 = '" & kh.Text & "' ","填报日期")
            End If
        End If
    Else
        If kh.Text = ""
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","款号 = '" & ks.Text & "'","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","样衣款号 = '" & ht.Text & "' and 款号 = '" & ks.Text & "'","填报日期")
            End If
        Else
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","客户 = '" & kh.Text & "'and 款号 = '" & ks.Text & "'","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","样衣款号 = '" & ht.Text & "'and 客户 = '" & kh.Text & "'and 款号 = '" & ks.Text & "' ","填报日期")
            End If
        End If
    End If
Else
    If ks.Text = ""
        If kh.Text = ""
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "'","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "' and 样衣款号 = '" & ht.Text & "'","填报日期")
            End If
        Else
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "' and 客户 = '" & kh.Text & "'","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "' and 样衣款号 = '" & ht.Text & "'and 客户 = '" & kh.Text & "' ","填报日期")
            End If
        End If
    Else
        If kh.Text = ""
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "' and 款号 = '" & ks.Text & "'","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "' and 样衣款号 = '" & ht.Text & "' and 款号 = '" & ks.Text & "'","填报日期")
            End If
        Else
            If ht.Text = ""
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "' and 客户 = '" & kh.Text & "'and 款号 = '" & ks.Text & "'","填报日期")
            Else
                rq.ComboList = DataTables("核价系统主表_Table1").GetComboListString("填报日期","技术担当 = '" & dd.text & "' and 样衣款号 = '" & ht.Text & "'and 客户 = '" & kh.Text & "'and 款号 = '" & ks.Text & "' ","填报日期")
            End If
        End If
    End If
End If

图片点击可在新窗口打开查看此主题相关图片如下:01.jpg
图片点击可在新窗口打开查看
如何去掉后面的0?



 回到顶部
帅哥哟,离线,有人找我吗?
hongye
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:一尾狐 帖子:437 积分:2943 威望:0 精华:0 注册:2011/3/15 12:49:00
  发帖心情 Post By:2020/3/2 13:39:00 [显示全部帖子]

不知道如何写这个代码,请帮忙提示

 回到顶部