Jump to content

Dynamic context menu coursing exception

- - - - -

  • Please log in to reply
No replies to this topic

#1
zombee81

zombee81

    Newbie

  • Members
  • Pip
  • 1 posts
Hi

I'm using VB.NET 2008 to write a pocket pc 2003 application using SQL CE 3.5and I'm having a problem creating a context menu from an SQL database.

This is what I have so far:

While _dtr.Read()

   _contextMenu.Text = _dtr("CardName")

   cmCardName.MenuItems.Add(_contextMenu)

End While

(The _dtr variable is a datareader)

The first time it loops it adds "American Express" to the menu, the second time it loops it tries to add "Bank of Scotland" to the menu but it courses an Argument Exception saying "Value does not fall within the expected range."

Does any one know how to solve this problem?

Many thanks in advance




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users