Dataview/Rowfilter help

bigboywasim

Member
Joined
Sep 29, 2006
Messages
18
Programming Experience
Beginner
What I have to do is get the Customer ID from a textbox. Then the program checks in the database for that customer ID. After it finds the Customer ID it checks and see if it has date closed. If it does then it spits it out in a listbox.

I am working with accessdatasource using ASP.Net in vb code. I have binded the data source in design view. I ran the query and it works. It checks for the customer ID and then checks for the dateclosed. I do not know how to display this and I am getting no exception error.

VB.NET:
Private Function GetSelectedCustomer()
        Dim Incident As New clsIncident
        Dim dvIncident As Data.DataView = CType( _
                 AccessDataSource1.Select(DataSourceSelectArguments.Empty), Data.DataView)
        'Copy from the results of a Select method.
        'lblCustomerID.Text = dvIncident(0)("CustomerID").ToString
        Incident.CutomerID = dvIncident(0)("CustomerID").ToString
        Incident.IncidentID = dvIncident(0)("IncidnetID").ToString
        Incident.TechID = dvIncident(0)("TechID").ToString
        Incident.DateClosed = dvIncident(0)("DateClosed").ToString
        Incident.DateOpened = dvIncident(0)("DateOpened").ToString
        Incident.ProductCode = dvIncident(0)("ProductCode").ToString
        Incident.Title = dvIncident(0)("Title").ToString

        Return Incident
    End Function

 Private Sub DisplayContact()

        lstIncident.Items.Clear()
        Dim Incident As clsIncident
        Dim IncidentEntry As DictionaryEntry

        Incident = CType(IncidentEntry.Value, clsIncident)
        lstIncident.Items.Add(Incident.Display)
    End Sub

Imports Microsoft.VisualBasic

Public Class clsIncident
    Public CutomerID As Integer
    Public IncidentID As Integer
    Public TechID As Integer
    Public ProductCode As String
    Public DateOpened As String
    Public DateClosed As String
    Public Title As String

    Public Function Display() As String
        Return "--Select an incident--" _
("Incident for product" + " " & ProductCode + " " & DateClosed + " " & Title)
    End Function
End Class
 

Latest posts

Back
Top