Ambigious Match Exception未得到处理 [英] Ambigious Match Exception was unhandled

查看:60
本文介绍了Ambigious Match Exception未得到处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是
我正在尝试制作一个 产品输入程序。但是我似乎得到了一个错误,我不知道如何解决这个问题。当我运行我的应用程序时会弹出一个错误,我的代码低于我在产品输入表单中使用的代码。

Hello,
I am trying to make a  program for Product Entry. However I seem to get a error and I have no clue how to fix this. When I run my application it would popup an error, my code is below which I use in Product entry form.


Imports System.Data.OleDb

Public Class frmProductForm

 Dim conn As New OleDbConnection
 Dim myqry As String = Nothing
 Dim mycmd As New OleDbCommand
 Dim mydr As OleDbDataReader
 Dim str As String = Nothing

 Private Sub frmProductForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 Call ListView1settings()
 Call Conn2DB()
 Call FillListview()
 End Sub

#Region "FillListView"
 Sub FillListview()
 ListView1.Items.Clear()
 myqry = "SELECT * from Product ORDER BY PID ASC"
 mycmd = New OleDbCommand(myqry, conn)
 mydr = mycmd.ExecuteReader

 While mydr.Read
 With ListView1
 .Items.Add(mydr("PID"))
 With .Items(.Items.Count - 1).SubItems
 .Add(mydr("PName"))
 .Add(mydr("SizeOfTiles"))   <- their error is
 '.Add(mydr("UnitPrice"))
 '.Add(mydr("UnitInStock"))
 '.Add(mydr("UnitOnOrder"))
 End With
 End With
 End While
 End Sub
#End Region

#Region "ListView1Settings"
 Sub ListView1settings()
 With ListView1.Columns
 .Add("PID", 50, HorizontalAlignment.Left)
 .Add("PName", 100, HorizontalAlignment.Left)
 '.Add("Last Name", 100, HorizontalAlignment.Left)
 '.Add("Address", 200, HorizontalAlignment.Left)
 .Add("Size of Tiles", 100, HorizontalAlignment.Left)
 '.Add("UnitPrice")
 '.Add("UnitInStock")
 '.Add("UnitOnOrder")
 End With
 End Sub
#End Region
....
....
End Class

推荐答案

人们似乎在阅读它但没有回应。因此,我得出结论要么我的问题不清楚,需要更多的代码我做什么...,正确方向的任何建议都表示赞赏,因为我的工作由于该错误而停止,我不知道
如何解决这个。



提前致谢
People seem to read it but do not response. Therefore I conclude either my question is not clear , need more code of what I do..., any suggestion in the right direction is appreciated because my work has stopped due to that error and I have no clue how to fix this.

Thanks in advance


这篇关于Ambigious Match Exception未得到处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆