本文介绍了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

推荐答案


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

10-20 08:34