Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Picker Integer Selection Problem
Message
De
30/04/2005 17:30:56
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Picker Integer Selection Problem
Versions des environnements
Environment:
VB.NET 1.1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01009940
Message ID:
01009940
Vues:
48
I have a visitor selection mmPicker configured to search based on Lastname.
Here are the mmPicker properties set:
PicklistValueMember = VisitorId
PicklistDisplayMember = VisitorLastName
PicklistSearchField = VisitorLastNameColumn
DataCommand = Select * From Visitors Order By VisitorLastName, VisitorFirstName, CompanyName
DataCommandType = Text

When the following code is called I get an "Input string was not in a correct format." error:
    Private Sub VisitorSelectionPicker_ItemSelected(ByVal sender As System.Object, ByVal e As OakLeaf.MM.Main.Windows.Forms.mmPickerItemSelectedEventArgs) Handles VisitorSelectionPicker.ItemSelected

        ' Find the position of the primary key selected in the Picker
        Dim visitorIdSelected As Integer = _
            CInt(e.dsSelectedItems.Tables.Item(0).Rows(0).Item("VisitorId"))

        ' TODO - Deterimine why Me.VisitorDataset assignment fails with "Input string was not in a correct format." error
        Me.VisitorDataset = _
            CType(Me.oVisitor.GetVisitorByVisitorId(visitorIdSelected), VisitorDataset)

    End Sub
The Bus Obj method is as follows (the SQL works when run in Query Analyzer):
    ' Returns a DataSet containing a Visitor for a specified VisitorId
    Public Function GetVisitorByVisitorId(ByVal visitorId As Integer) As DataSet

        ' Get a reference to the data access object
        Dim dao As mmDataAccessBase = Me.GetDataAccessObject()

        ' Create and configure parameter objects
        Dim visitorParam As IDbDataParameter = _
            dao.CreateParameter("@VisitorId", visitorId)

        ' Get a DataSet filled with the result set
        Dim dsVisitor As DataSet = _
        Me.GetDataSet( _
            "SELECT * FROM Visitors WHERE" + _
            " VisitorId = @VisitorId Order By Visitors.VisitorLastName, " _
            + "Visitors.VisitorFirstName", visitorParam)

        Return dsVisitor

    End Function
What am I missing getting this to work as desired?
THANKS
Joe Salvatore, Programmer/Analyst - The Stellar Group
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform