Question I connot able to filter the current user record using c# and MS Access DB

Status
Not open for further replies.

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.
UnkcX.png

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 :

NSoFf.png



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();
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,085
Location
Chesapeake, VA
Programming Experience
10+
You already have another thread open about this. Closing this thread...
 
Status
Not open for further replies.
Top Bottom