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 SubThe 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 FunctionWhat am I missing getting this to work as desired?