本文介绍了Subitem不是listview项的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我不知道为什么会这样。我想将listview数据插入到我的其他表中,但继续得到此错误子项不是listview项的成员。请帮帮我 我尝试了什么: Private Sub orderButton_Click (发送者作为对象,e作为EventArgs)处理orderButton.Click 尝试 每个项目作为ListViewItem在myCart.Items中 Dim sql As新的StringBuilder sql.AppendLine(INSERT INTO newMedicinesOrders) sql.AppendLine(() sql.AppendLine(, medicineName) sql.AppendLine(,power) sql.AppendLine(,form) sql.AppendLine( ,fQuantity) sql.AppendLine(,iQuantity) sql.AppendLine(,type) sql.AppendLine( ,费用) sql.AppendLine()) sql.AppendLine(VALUES) sql.AppendLine( () sql.AppendLine(,'& item.SubItems(1).Text &安培; ') sql.AppendLine(,'& power.Text&') sql.AppendLine(,'& Form .Text&') sql.AppendLine(,'& fQuantity.Text&') sql.AppendLine(,' & iQuantity.Text&') sql.AppendLine(,'& Type.Text&') sql.AppendLine (,'& iCost.Text&') sql.AppendLine(,'& Type.Text&') sql.AppendLine()) Dim命令As New MySqlCommand command.CommandText = sql.ToString command.Connection = con2 command.ExecuteNonQuery() 下一页 Catch ex As Exception Response.Write(ex) 结束尝试 结束子I don't know why this is happening. I want to insert my listview data to to my other table but keeps on getting this error subitem is not a member of listview item. Please help meWhat I have tried:Private Sub orderButton_Click(sender As Object, e As EventArgs) Handles orderButton.Click Try For Each item As ListViewItem In myCart.Items Dim sql As New StringBuilder sql.AppendLine(" INSERT INTO newMedicinesOrders ") sql.AppendLine(" ( ") sql.AppendLine(" ,medicineName") sql.AppendLine(" ,power") sql.AppendLine(" ,form") sql.AppendLine(" ,fQuantity") sql.AppendLine(" ,iQuantity") sql.AppendLine(" ,type") sql.AppendLine(" ,cost") sql.AppendLine(" ) ") sql.AppendLine(" VALUES ") sql.AppendLine(" ( ") sql.AppendLine(" ,'" & item.SubItems(1).Text & "' ") sql.AppendLine(" ,'" & power.Text & "' ") sql.AppendLine(" ,'" & Form.Text & "' ") sql.AppendLine(" ,'" & fQuantity.Text & "' ") sql.AppendLine(" ,'" & iQuantity.Text & "' ") sql.AppendLine(" ,'" & Type.Text & "' ") sql.AppendLine(" ,'" & iCost.Text & "' ") sql.AppendLine(" ,'" & Type.Text & "' ") sql.AppendLine(" ) ") Dim command As New MySqlCommand command.CommandText = sql.ToString command.Connection = con2 command.ExecuteNonQuery() Next Catch ex As Exception Response.Write(ex) End TryEnd Sub推荐答案 这篇关于Subitem不是listview项的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-24 02:03