Ibtisam
New member
- Joined
- Nov 30, 2021
- Messages
- 4
- Programming Experience
- 1-3
I connot able to filter the current user record. I want to display the data of current user only. But I did not understand how to handl query.
here is the ss of login.
As I selected Student, and username =50 and pass=50 ,
and when i press he show button this will display all the record but i want only current user data :
here is the code :
here is the ss of login.

As I selected Student, and username =50 and pass=50 ,
and when i press he show button this will display all the record but i want only current user data :

here is the code :
Need to updation in sql command:
conn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
OleDbDataAdapter sda = new OleDbDataAdapter(@"SELECT student.s_id, student.f_name, student.l_name, student.email, student.address, course.c_id, course.cname, resultdate.resultgrade FROM ((student INNER JOIN resultdate ON student.s_id = resultdate.s_id) INNER JOIN course ON resultdate.c_id = course.c_id)", conn);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
//dataGridView1.Text = dt.Rows.Count.ToString();
conn.Close();