Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4030372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:27:46+00:00 2026-05-20T11:27:46+00:00

Hers the form code: Imports TechSupportData Public Class frmOpenIncidents Private Sub frmOpenIncidents_Load(ByVal sender As

  • 0

Hers the form code:

Imports TechSupportData

Public Class frmOpenIncidents

Private Sub frmOpenIncidents_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim incidentList As List(Of Incident)
    Try
        incidentList = IncidentDB.GetIncidents
        If incidentList.Count > 0 Then
            Dim incident As Incident
            For i As Integer = 0 To incidentList.Count - 1
                incident = incidentList(i)
                lvIncidents.Items.Add(incident.ProductCode)
                lvIncidents.Items(i).SubItems.Add(incident.DateOpened)
                lvIncidents.Items(i).SubItems.Add(incident.CustomerID)
                lvIncidents.Items(i).SubItems.Add(incident.TechID)
                lvIncidents.Items(i).SubItems.Add(incident.Title)
            Next
        Else
            MessageBox.Show("All Incidents are taken care of")
            Me.Close()
        End If
    Catch ex As Exception
        MessageBox.Show(ex.Message, ex.GetType.ToString)
        Me.Close()
    End Try
End Sub
End Class

And heres the class its working with:

Imports System.Data.SqlClient

Public Class IncidentDB
    Public Shared Function GetIncidents() As List(Of IncidentDB)
        Dim incidentList As New List(Of IncidentDB)
        Dim connection As SqlConnection = TechSupportDB.GetConnection
        Dim selectStatement As String _
            = "SELECT CustomerID, ProductCode, TechID, DateOpened, Title" _
            & "FROM(Incidents)" _
            & "WHERE DateClosed IS NULL"
        Dim selectCommand As New SqlCommand(selectStatement, connection)
        Try
            connection.Open()
            Dim reader As SqlDataReader = selectCommand.ExecuteReader()
            Dim incident As Incident
            Do While reader.Read
                incident = New Incident
                incident.IncidentID = reader("IncidentID").ToString
                incident.CustomerID = reader("CustomerID").ToString
                incident.ProductCode = reader("ProductCode").ToString
                incident.DateOpened = reader("DateOpened").ToString
            Loop
            reader.Close()
        Catch ex As Exception
            Throw ex
        Finally
            connection.Close()
        End Try
        Return incidentList
    End Function
End Class

Heres the error I’m getting from Visual Studio:

Error 1 Value of type ‘System.Collections.Generic.List(Of TechSupportData.IncidentDB)’ cannot be converted to ‘System.Collections.Generic.List(Of TechSupportData.Incident)’. C:\Users\Cody\Desktop\School\Current\ITECH4269 Visual Basic\Assignment2CodyStewart\Assignment2CodySteawrt\Assignment2CodySteawrt\frmOpenIncidents.vb 8 28 Assignment2CodySteawrt

Any guidance or suggestions would be much appreciated, thanks a lot.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:27:47+00:00Added an answer on May 20, 2026 at 11:27 am

    In class frmOpenIncidents you’ve defined incidentList as a list of Incidents:

    Dim incidentList As List(Of Incident)
    

    then set it:

    incidentList = IncidentDB.GetIncidents
    

    But that IncidentDB method is defined as returning a list of Incident*DB*:

    Public Shared Function GetIncidents() As List(Of IncidentDB)
    

    Solution might be to change the first definition to this?

    Dim incidentList As List(Of IncidentDB)
    

    You need to choose a name for the class – Incident or IncidentDB – and use it consistently to get rid of all similar errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across this question about callbacks in Java. Hers is the running code
Code: $testing=sniper this and sniper that; $connectors=array('and', 'now', 'but', 'still', 'so', 'only', 'therefore', 'moreover',
After the previous question What are the important rules in Object Model Design, now
I found some php code that was an alternative to cron I'm a total
I have a grouped UITableView and want to select some rows. Hers some handy
We have application named Milekeeper , which relays users to send invitations to race
Ok so i have a character on the screen and when it moves the
We have created a facebook-app which contains a fb:comment field. We have included the
I am using django 1.2 to create a multi site shop. I need multiple
I'm having a problem when using the jquery .each() and .ajax() functions together. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.