Private Sub btnNewStudent_Click(sender As Object, e As EventArgs) Handles btnNewStudent.Click
Dim name As String = InputBox("Enter the Student's Name", "Name", "Student Name")
name = StrConv(name, vbProperCase)
addStudent(name)
If name = "" Then
errorMessage("Please Enter a Name")
lstStudents.Items.Remove("")
End If
End Sub
Error Description:
"System.NotSupportedException: No data is available for encoding
1252. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Error Details:
System.NotSupportedException HResult=0x80131515 Message=No data
is available for encoding 1252. For information on defining a custom
encoding, see the documentation for the Encoding.RegisterProvider
method. Source=Microsoft.VisualBasic.Core StackTrace: at
Microsoft.VisualBasic.Strings.StrConv(String str, VbStrConv
Conversion, Int32 LocaleID) at
StudentTrackerVB.frmStudentTrackers.btnNewStudent_Click(Object sender,
EventArgs e) in E:CollegeYear 2Unit 15 - Object Oriented
ProgrammingAssignment
3StudentTrackerVBStudentTrackerVBForm1.vb:line 11 at
System.Windows.Forms.Control.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnClick(EventArgs e) at
System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at
System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks) at
System.Windows.Forms.Control.WndProc(Message& m) at
System.Windows.Forms.ButtonBase.WndProc(Message& m) at
System.Windows.Forms.Button.WndProc(Message& m) at
System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, WM msg,
IntPtr wparam, IntPtr lparam)
When I try to make name into ProperCase, it comes up with an error. I've done a similar thing for items in an array making them UpperCase which works perfectly. But for some reason, this doesn't?
What am I doing wrong xD
question from:
https://stackoverflow.com/questions/65919736/receiving-system-notsupportedexception-when-trying-to-make-a-string-propercase 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…