以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 循环/报错健值重复 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=190115) |
-- 作者:yifan3429 -- 发布时间:2024/1/17 16:43:00 -- 循环/报错健值重复 For Each dr As DataRow In dt.sqlSelect("[启用] = 1 and [产品系列] = \'展厅新品\'", "", "GKBox") \' With wb.AddArticle("", dr("ID")) .AddTitle("h4", "1.空间 :" & dr("GKBox"),) .AddTitle("h4", "2.产品系列 :" & dr("Model")) .AddImage( ww & dr("视觉_产品")) .AddTitle("h1", dr("Part")) .AddTitle("h4", "3.产品名称:</br>") .AddTitle("h3", dr("产品名称") & dr("产品俗称")) .AddTitle("h4", "4.设计说明:</br>") .AddTitle("h2", dr("设计说明")) .AddTitle("h4", "5.产品买点") .AddTitle("h2", dr("产品买点")) .AddTitle("h4", "6.计价规则:</br>") .AddTitle("h2", dr("计价方案")) .AddTitle("h4", "7.工艺说明") .AddTitle("h2", dr("工艺说明")) End With With wb.AddListGroup("", "s1", "8.主材详情") .Add("ls5", "主材详情", "点击链接", ww & dr("视觉_详情")).Badge = "新" .Add("ls6", "工艺详情", "点击链接", dr("视觉_全景")).Badge = "新" End With With wb.AddListGroup("", "s2", "9.设计效果") .Add("ls5", "产品详情", "点击链接", ww & dr("视觉_详情")).Badge = "新" .Add("ls6", "设计全景", "点击链接", dr("视觉_全景")).Badge = "新" End With With wb.AddListGroup("", "s3", "10.品牌官网") .Add("ls5", "京东官网", "点击链接", dr("官网商城_京东")).Badge = "新" .Add("ls6", "天猫官网", "点击链接", dr("官网商城_天猫")).Badge = "新" End With wb.AppendHTML("<br/>") Next 一条数据正常 多条就会报错 键值重复
[此贴子已经被作者于2024/1/17 16:43:15编辑过]
|
-- 作者:有点蓝 -- 发布时间:2024/1/17 17:17:00 -- 控件不能有重复的ID With wb.AddListGroup("", "s1" & dr("ID"), "8.主材详情") .Add("ls5" & dr("ID"), "主材详情", "点击链接", ww & dr("视觉_详情")).Badge = "新" .Add("ls6" & dr("ID"), "工艺详情", "点击链接", dr("视觉_全景")).Badge = "新" End With With wb.AddListGroup("", "s2" & dr("ID"), "9.设计效果") .Add("ls7" & dr("ID"), "产品详情", "点击链接", ww & dr("视觉_详情")).Badge = "新" .Add("ls8" & dr("ID"), "设计全景", "点击链接", dr("视觉_全景")).Badge = "新" End With |
-- 作者:yifan3429 -- 发布时间:2024/1/17 18:47:00 -- Dim s11 As Integer = 1 For Each dr As DataRow In dt.sqlSelect("[启用] = 1 and [产品系列] = \'展厅新品\'", "", "GKBox") \' wb.AppendHTML("---------------<br/>----------------") s11 = s11 + 1 Dim s12 As Integer = s11 + 1 Dim s13 As Integer = s12 + 1 Dim s14 As Integer = s13 + 1 With wb.AddArticle("", s14.ToString) .AddTitle("h4", "1.空间 :" & dr("GKBox"),) .AddTitle("h4", "2.产品系列 :" & dr("Model")) .AddImage( ww & dr("视觉_产品")) .AddTitle("h1", dr("Part")) .AddTitle("h4", "3.产品名称:</br>") .AddTitle("h3", dr("产品名称") & dr("产品俗称")) .AddTitle("h4", "4.设计说明:</br>") .AddTitle("h2", dr("设计说明")) .AddTitle("h4", "5.产品买点") .AddTitle("h2", dr("产品买点")) .AddTitle("h4", "6.计价规则:</br>") .AddTitle("h2", dr("计价方案")) .AddTitle("h4", "7.工艺说明") .AddTitle("h2", dr("工艺说明")) End With \' MessageBox.Show(s12.ToString) Dim ms11 As String = s11.ToString Dim cs11 As String = ms11 & "c1" Dim cs12 As String = ms11 & "c2" With wb.AddListGroup("", ms11 , "8.主材详情") .Add(cs11, "主材详情", "点击链接", ww & dr("视觉_详情")).Badge = "新" .Add(cs12, "工艺详情", "点击链接", dr("视觉_全景")).Badge = "新" End With \' Dim ms12 As String = s12.ToString \' Dim cs21 As String = ms12 & "c3" \' Dim cs22 As String = ms12 & "c4" \' With wb.AddListGroup(ms12, ms12, "9.设计效果") \' .Add(cs21, "产品详情", "点击链接", ww & dr("视觉_详情")).Badge = "新" \' .Add(cs22, "设计全景", "点击链接", dr("视觉_全景")).Badge = "新" \' End With \' Dim ms13 As String = s13.ToString \' Dim cs31 As String = ms13 & "c1" \' Dim cs32 As String = ms13 & "c2" \' With wb.AddListGroup("", s13.ToString, "10.品牌官网") \' .Add(cs31, "京东官网", "点击链接", dr("官网商城_京东")).Badge = "新" \' .Add(cs32, "天猫官网", "点击链接", dr("官网商城_天猫")).Badge = "新" \' End With \' wb.AppendHTML("<br/>") Next 有色部分还是会报错 无解 求助
|
-- 作者:有点蓝 -- 发布时间:2024/1/18 8:35:00 -- 说明还是重复了,请参考2楼用法使用,如果每行dr("ID")会有重复值,改为使用dr("_identify") |
-- 作者:chnfo -- 发布时间:2024/1/18 22:19:00 -- 如果你的ID使用UUID的生成方法,那重复的概率=0。guid.newguid.tostring [此贴子已经被作者于2024/1/18 22:18:57编辑过]
|