hi, this is my problems:
i have a text file contains " staff id, male/female, first name+surname", which look like this:
11111,M,John Ford
22222,F,May Gray
33333,M,Jo Sun
etc.

i have 2 problems:
1: i dont know how to display a error message if the text file is not found.
(i can display all the staff's in listbox with one click)
2: i need to display "male" only in the listbox.

can anyone help me?
this is the code i'm using to display all staff members, but couldn't show the error msg if file is not found.

thx

Private Sub displaynames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles displaynames.Click 
       ListBox1.Items.Clear() 
       Dim Members As String = "path" 
       Dim rvSR As New IO.StreamReader(Members) 
       Do While rvSR.Peek <> -1 
           ListBox1.Items.Add(rvSR.ReadLine()) 
       Loop 
       rvSR.Close() 
       If Members = "" Then 
           MessageBox.Show("No Text is found") 
       End If 
   End Sub

For problem 1:
if pre .net
http://www.aivosto.com/vbtips/errorhandling.html

else if .net
try{}
catch {}

2. I don't know what you mean. You want to make the Males females as well?

simple if/compare statement.

Please clarify what you mean.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.