Please select 'Save As' Option.", "Error In Saving") MessageBox.Show("Employee saved successfully.", "Success") SavedEmployeeFile = File.AppendText(fileName) 'Throws error if file could Not be created SavedEmployeeFile.WriteLine(txtEmailAddress.Text) SavedEmployeeFile.WriteLine(txtExtension.Text) SavedEmployeeFile.WriteLine(txtTelephone.Text) SavedEmployeeFile.WriteLine(ComboBo圎mpDepartment.Text) SavedEmployeeFile.WriteLine(txtEmployeeNumber.Text) SavedEmployeeFile.WriteLine(txtLastName.Text) SavedEmployeeFile.WriteLine(txtMiddleName.Text) SavedEmployeeFile.WriteLine(txtFirstName.Text) 'writes information entered by user into file SavedEmployeeFile = File.CreateText(fileName) 'Adds the department options to the combo box dropdown listĬomboBo圎("Accounting")ĬomboBo圎("Administration")ĬomboBo圎("Marketing") Private Sub frmEmployeeData_Load(sender As Object, e As EventArgs) Handles MyBase.Load Here is my code for the form: Option Strict Off I am very new to visual basic and am unsure of why this is not working. The issue I am experiencing is that it will run the TRY and ignore the CATCH, allowing invalid data to pass and save to the file. I am working on an employee database and am having issues with my TRY\CATCH for saving records as it pertains to exception handling.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |