Foxtable(狐表)用户栏目专家坐堂 → 能不能帮我改一下这个代码。


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

主题:能不能帮我改一下这个代码。

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


加好友 发短信
等级:超级版主 帖子:107014 积分:544295 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/2 14:55:00 [显示全部帖子]

Dim dlg As new OpenFileDialog
If dlg.ShowDialog = DialogResult.OK Then
    Dim ftp1 As New FtpClient
    ftp1.Host="binyang.66ip.net"
    ftp1.Account = "byftpuser"
    ftp1.Password = "654321"
    Dim filters As String = "合同号 = '" & e.Form.Controls("合同号").Text & "'And 款号 = '" &  e.Form.Controls("款号").Text & "' And 业务担当 = '" & e.Form.Controls("业务担当").Text & "' And 合同交期 = '" & e.Form.Controls("合同交期").Text & "' And 客户名称 = '" & e.Form.Controls("客户名称").Text & "' And 品名 = '" & e.Form.Controls("品名").Text & "'"
    Dim cmd As New SQLCommand
    cmd.CommandText = "select * From {订单主表} where " & filters
    Dim dtsj As DataTable
    dtsj = cmd.ExecuteReader(True) '记得将参数设置为True
if dtsj.datarows.count = 0 then
msgbox(“没有数据”)
return
end if
    If ftp1.Upload(dlg.FileName, "/kst/"& e.Form.Controls("合同号").Text & e.Form.Controls("款号").Text & ".jpg") = True Then
        dtsj.datarows(0)("款式图片") &= IIF(dtsj.datarows(0).IsNull("款式图片"), "", vbcrlf) & "/kst/"& e.Form.Controls("合同号").Text & e.Form.Controls("款号").Text & ".jpg"
        Messagebox.show("上传完成!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Else
        Messagebox.show("上传失败!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    End If
    ftp1.close
End If

 回到顶部