这部分代码是否有误,运行时出现末尾错误提示 提示单位名称 支部名称列无效 麻烦老师们指导下
cmd11.Comma ndText="sel ect 图片 fro m web上传图片附件 where 姓名= '" & xingming & "'and 单位名称= '" & danweimingcheng & "' and 支部名称= '" & suoshuzhibu & "'"
图片 是二进制列
其中 单独如下:可以根据姓名筛选得到数据
cmd11.Comma ndText="sel ect 图片 fro m web上传图片附件 where 姓名= '" & xingming & "'"
代码如下:
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
Dim xingming As String = e.PostValues("姓名")
Dim danweimingcheng As String = e.PostValues("单位名称")
Dim suoshuzhibu As String = e.PostValues("所属支部")
wb.AddForm("","form1","getVimg.htm")
MessageBox.Show(danweimingcheng)
MessageBox.Show(suoshuzhibu )
Dim cmd11 As New SQ LCommand
cmd11.Connection Name = "智慧党建"
cmd11.Comma ndText="sel ect 图片 fro m web上传图片附件 where 姓名= '" & xingming & "'and 单位名称= '" & danweimingcheng & "' and 支部名称= '" & suoshuzhibu & "'"
Dim dt As DataTable = cmd11.Execu teReader
Dim src As String
With wb.AddInputGroup("form1","ipg11","客户资料")
.AddInput("单位名称","单位名称","text").value = danweimingcheng
.AddInput("所属支部","所属支部","text").value = suoshuzhibu
.AddInput("姓名","姓名","text").value = xingming
End With
With wb.AddInputGroup("form1","ipg1111","图片信息")
With .AddUploader("up111","",True)
.AllowAdd = False '关闭文件上传功能
For Each dr As DataRow In dt.DataRows
Dim imagebytes As Byte() = dr("图片")
src = Convert.ToBase64String(imagebytes)
.AddImage("data:image/jpeg;base64," & src)
Next
With wb.AddArticle("","ar1")
.UseGallery = True '启用Gallery,必须放在第一行
End With
End With
End With
With wb.AddInputGroup("form1","ipg33","")
With wb.AddButtonGroup("form1","btg1",True) '垂直排列
.Add("btn5", "返回首页", "", "default.htm")
End With
End With
e.WriteString(wb.Build) '生成网页