Hello good evening to all of you! I know this question is basic but I am really having a hard time doing it.

I am a creating a Employee information system. My dilemma is I want to view all the informtion of all the employees from the department that I selected from the menu strip but how could I do that? I really need your help........

Thanks for your immediate reply........

What are you having a problem with? Is it selecting the data from the database or is it displaying the data?

Here is an interface I drew to show how it should look.........I really don't know where to start or how to start it...........please help me........

selecting the data from the database by clicking the selected department from the menustrip.......

what is the primary key?
can you send me the code you have tried.............
hope this will help

 myConnection = New SqlConnection(connectionstring)
        myConnection.Open()


        Dim TempData As New DataTable
         myCommand1 = New SqlCommand("SELECT * FROM Departement ", myConnection)
        myCommand1.ExecuteNonQuery()

        '    Dim dr1 As SqlDataReader = myCommand1.ExecuteReader

        Dim pr As String
          Do While dr1.Read()
            ' pr = dr1("Category").ToString


            ''''''''''''''''''''''''
            ' For i = 0 To TempData.Rows.Count-1
            Dim newItem1 As New ListViewItem(dr1.Item("Name").ToString)
            newItem1.SubItems.Add(dr1("Postion"))
            newItem1.SubItems.Add(dr1("Address"))
              newItem1.SubItems.Add(dr1("Datehired"))
            ListView1.Items.Add(newItem1)

        Loop
        myConnection.Close()

will it work if I placed this code in the menu strip???

there are three categories, by department, by status and by nature of work, should I use If-else???? how should I do it using your code???

thanks for the replies.............

Yes it will work, place the code in the CLICK function so that whenever that sub menu is being clicked, the code will execute then.

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.