473,326 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

A first chance exception of type 'System.Reflection.AmbiguousMatchException' occurred

Please help i got a problem in visual basic .net and im using visual studio 2010
when I run program to display records from database to listview i encountered a problem in immediate window and it says:

A first chance exception of type 'System.Reflection.AmbiguousMatchException' occurred in Microsoft.VisualBasic.dll

I encountered that problem when one of my data field in recordset is null and the program doesn't display accurately

here is my code:

Expand|Select|Wrap|Line Numbers
  1. Public cn As New MySqlConnection
  2.     Public recurring As String
  3.  
  4.  
  5.     Public Sub LoadEvents()
  6.         On Error Resume Next
  7.         Dim str_2 As String = "SELECT * FROM tbl_event ORDER BY Date"
  8.         Dim rsEvent As New MySqlDataAdapter
  9.         Dim SQLCommand As New MySqlCommand
  10.         Dim TABLE As New DataTable
  11.         Dim i As Integer
  12.  
  13.         With SQLCommand
  14.             .CommandText = str_2
  15.             .Connection = cn
  16.         End With
  17.  
  18.         With rsEvent
  19.             .SelectCommand = SQLCommand
  20.             .Fill(TABLE)
  21.         End With
  22.  
  23.         LVEvList.Items.Clear()
  24.  
  25.         For i = 0 To TABLE.Rows.Count - 1
  26.             With LVEvList
  27.                 .Items.Add(TABLE.Rows(i)("ID"))
  28.                 With .Items(.Items.Count - 1).SubItems
  29.                     .Add(TABLE.Rows(i)("Event_Name"))
  30.                     .Add(TABLE.Rows(i)("Venue"))
  31.                     .Add("" & Format(TABLE.Rows(i)("Date"), "MMM dd, yyyy"))
  32.                     .Add("" & Format(TABLE.Rows(i)("Time"), "Long Time"))
  33.                     .Add(TABLE.Rows(i)("Category"))
  34.                     .Add(TABLE.Rows(i)("Recurring"))
  35.                 End With
  36.             End With
  37.         Next i
  38.     End Sub
  39.  
  40.     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  41.         If cn.State = ConnectionState.Closed Then
  42.             cn.ConnectionString = "SERVER = localhost; USERID = root; PASSWORD=; DATABASE = clsf_member_information;"
  43.             cn.Open()
  44.             LoadEvents()
  45.         End If
  46.     End Sub
please help to resolve this problem thanks
May 25 '12 #1
0 1802

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: karunakar | last post by:
Hi All Here iam getting this Error "Specified cast is not valid." My Project has Onc solution diffrent class libarary In that solution DALfactory solution iam getting this error I was calling...
2
by: Juanjo | last post by:
Hi all I get the following error: 'A first chance exception of type 'System.InvalidOperationException' occurred in system.dll Additional information: The requested Performance Counter is not...
3
by: Luis Esteban Valencia | last post by:
A page let of work for me I commented almost all lines but nothing the code is this
0
by: camp | last post by:
Hi, The question bellow was posted on .NET 247 with no resolve (issue seems to be extremly difficult) I am having exactly the same problem, so I copied the question and pasted it bellow for...
3
by: Pieter | last post by:
Hi, I have a Windows Forms application (VB.NET 2.0) which uses a Class Library in C#. The application runs fine, but when I run it in debug mode, I get several "A first chance exception of type...
3
by: GS | last post by:
why am i getting A first chance exception of type 'System.NullReferenceException' occurred in myapp.exe below? and what can i do get rid of it? Private Function getPrefxType() As String If...
0
by: sanishvarier | last post by:
Hi, I am getting the fillowing error A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll when trying to use the OpenFile property of OpenFile dialog box. ...
7
by: Pixel.to.life | last post by:
Gurus, Another question on one of the coveted Microsoft products: JIT debugger with VS2005. I have a managed app that builds great on one machine (Vista Home basic, VS2005, JIT enabled for...
0
by: Pixel.to.life | last post by:
Gurus, Another question on one of the coveted Microsoft products: JIT debugger with VS2005. I have a managed app that builds great on one machine (Vista Home basic, VS2005, JIT enabled for...
1
by: yimma216 | last post by:
Hi I have been trying to get the data display on the datagrid after selecting a customer. With the same connection it populates the selection right. But just do not seem to extract the following...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.