1. Value of type '1-dimensional array of String' cannot be converted to 'String'. C:\Users\Black & Gold\AppData\Local\Temporary\projects\WindowsAppli cation1\Form1.vb 59 33 WindowsApplication1
2. 'Char' values cannot be converted to 'Integer'. Use 'Microsoft.VisualBasic.AscW' to interpret a character as a Unicode value or 'Microsoft.VisualBasic.Val' to interpret it as a digit. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 60 45 WindowsApplication1
3. Name 'oLaon' is not declared. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 61 25 WindowsApplication1
4. 'Char' values cannot be converted to 'Integer'. Use 'Microsoft.VisualBasic.AscW' to interpret a character as a Unicode value or 'Microsoft.VisualBasic.Val' to interpret it as a digit. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 61 43 WindowsApplication1
5. Value of type 'Char' cannot be converted to 'Decimal'. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 62 44 WindowsApplication1
6. Expression expected. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 63 87 WindowsApplication1
7. Syntax error. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 64 25 WindowsApplication1
8. Value of type '1-dimensional array of String' cannot be converted to 'String'. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 94 33 WindowsApplication1
9. 'Char' values cannot be converted to 'Integer'. Use 'Microsoft.VisualBasic.AscW' to interpret a character as a Unicode value or 'Microsoft.VisualBasic.Val' to interpret it as a digit. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 95 41 WindowsApplication
10. 'Char' values cannot be converted to 'Integer'. Use 'Microsoft.VisualBasic.AscW' to interpret a character as a Unicode value or 'Microsoft.VisualBasic.Val' to interpret it as a digit. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 96 49 WindowsApplication1
11. 'Char' values cannot be converted to 'Integer'. Use 'Microsoft.VisualBasic.AscW' to interpret a character as a Unicode value or 'Microsoft.VisualBasic.Val' to interpret it as a digit. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 97 47 WindowsApplication1
12. Value of type 'Char' cannot be converted to 'Decimal'. C:\Users\Black & Gold\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 98 48 WindowsApplication1
Expand|Select|Wrap|Line Numbers
- Imports System.IO
- Imports System.Text
- Public Class Loan
- Dim iTerm As Integer
- Dim decRate As Decimal
- Dim strDesc As String
- Dim strLoanId As String
- Public Property Term() As Integer
- Get
- Return iTerm
- End Get
- Set(ByVal value As Integer)
- iTerm = value
- End Set
- End Property
- Public Property iRate() As Decimal
- Get
- Return decRate
- End Get
- Set(ByVal value As Decimal)
- decRate = value
- End Set
- End Property
- Public Property Desc() As Integer
- Get
- Return strDesc
- End Get
- Set(ByVal value As Integer)
- iTerm = value
- End Set
- End Property
- Private Property LoanId() As Integer
- Get
- Return strLoanId
- End Get
- Set(ByVal value As Integer)
- iTerm = value
- End Set
- End Property
- Public Shared Function SelectLoanList() As ArrayList
- Dim loanlist As New ArrayList()
- Dim sr As StreamReader
- Dim sPath As String
- Dim sLine As String
- Dim aLine As String
- Try
- #If DEBUG Then
- sPath = Microsoft.VisualBasic.Left(Application.StartupPath, Len(Application.StartupPath) - 9)
- #Else
- sPath = Microsoft.VisualBasic.Left(Application.StartupPath, Len(Application.StartupPath) - 11)
- #End If
- sPath = sPath & "loans1.txt"
- sr = New StreamReader(sPath)
- If Not IsNothing(sr) Then
- Do
- sLine = sr.ReadLine()
- If Not IsNothing(sLine) Then
- Dim oLoan As New Loan()
- aLine = sLine.Split(",")
- oLoan.LoanId = CInt(aLine(0))
- oLaon.Term = CInt(aLine(1))
- oLoan.iRate = CDec(aLine(2))
- oLoan.Desc = "Loan Amount" & oLoan.LoanId & ": " & oLoan.Term &
- "Yrs @" & oLoan.iRate & "%"
- loanlist.Add(oLoan)
- End If
- Loop
- End If
- Catch ex As Exception
- Throw
- End Try
- Return loanlist
- End Function
- Public Shared Function SelectLoan(ByVal iLoan As Integer) As Loan
- Dim oloan As New Loan()
- Dim sr As StreamReader
- Dim sPath As String
- Dim sLine As String
- Dim aLine As String
- Dim strLoan As New StringBuilder()
- Try
- #If DEBUG Then
- sPath = Microsoft.VisualBasic.Left(Application.StartupPath, Len(Application.StartupPath) - 9)
- #Else
- sPath = Microsoft.VisualBasic.Left(Application.StartupPath, Len(Application.StartupPath) - 11)
- #End If
- sPath = sPath & "loans1.txt"
- sr = New StreamReader(sPath)
- If Not IsNothing(sr) Then
- Do
- sLine = sr.ReadLine()
- If Not IsNothing(sLine) Then
- aLine = sLine.Split(",")
- If iLoan = CInt(aLine(0)) Then
- oloan.LoanId = CInt(aLine(0))
- oloan.Term = CInt(aLine(1))
- oloan.iRate = CDec(aLine(2))
- strLoan.Append("Loan ")
- strLoan.Append(oloan.LoanId)
- strLoan.Append(": ")
- strLoan.Append(oloan.Term)
- strLoan.Append("Yrs@ ")
- strLoan.Append(oloan.iRate)
- strLoan.Append("% ")
- oloan.Desc = strLoan.ToString
- End If
- End If
- Loop Until sLine Is Nothing
- End If
- Catch ex As Exception
- Throw
- End Try
- Return oloan
- End Function
- Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
- Try
- ComboBox1.Items.Add("Loan 1: 7 Yrs @ 5.35%")
- ComboBox1.Items.Add("Loan 2: 15 Yrs @ 5.5%")
- ComboBox1.Items.Add("Loan 3: 30 Yrs @ 5.75%")
- Catch ex As Exception
- MsgBox(ex.ToString)
- Console.WriteLine(ex.ToString)
- End Try
- End Sub
- End Class