Listing based on query in bank

0

First of all, I apologize if the question is vague, since it is a very broad topic.

Today I have a system of registration and consultation of students, where the query is made exclusively by CPF, since it is a unique identifier and a constraint in the database will guarantee me that there will be no recurring CPF, thus returning only one result in the query.

The query in the database is done via dataSet, by a helper class we have. The method is basically this:

CeltaWare.Data.SqlHelper.FillDataset(
                    sqlConn,
                    CommandType.Text,
                    "SELECT * FROM ALUNOS WHERE CPF = @CPF",
                    dataSet,
                    new string[] { "Alunos" },
                    new SqlParameter("@CPF", aluno.Cpf));

And if in the case, do I want to go to search by name too?

Obviously, there may be several students with the same first name, and then the application should return a list to select the student we want.

The question is: How should this list be created? Being a beginner in C #, I do not have much idea how to do this. Would it be a new Form, with labels that would have Text replaced by our search?

Thank you in advance!

    
asked by anonymous 23.03.2018 / 19:07

1 answer

1

On my system, we do this, with difference in language only.

  • We always query by name. - We try to make the return of the query greater than 1, present the data in a Screen ("People List") - Where we put the Code, CPF and the Name of the Person. --- Then when you double click on the Person, loads the data in the register.

- The Screen is composed of a List.

I do not know if it was clear, but it follows the same principle of the solution that you imagined.

    
26.03.2018 / 21:05