Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
C#
string sql = "";
OleDbConnection conn = new OleDbConnection(oldbconnstring);
sql = "select AttendanceLogs.InTime,AttendanceLogs.OutTime,Employees.EmployeeCode
 FROM AttendanceLogs INNER JOIN Employees ON AttendanceLogs.EmployeeId  =  Employee.EmployeeId";

OleDbCommand cmd = new OleDbCommand(sql, conn);
conn.Open();
OleDbDataAdapter adapter = new OleDbDataAdapter(cmd);
adapter.Fill(results);


plz help i am getting error
Syntax error in JOIN operation.
how to do single join in access database using C#
Posted
Updated 10-Sep-14 20:09pm
v2

Your table is called Employees...in the ON clause you have Employee.EmployeeId...I'd say that is an error :)
 
Share this answer
 
You have missed s in Employee. Use this sql instead

SQL
select AL.InTime,AL.OutTime,E.EmployeeCode
 FROM AttendanceLogs AL INNER JOIN Employees E ON AL.EmployeeId  =  E.EmployeeId
 
Share this answer
 
v2
Comments
sadhana4 11-Sep-14 2:46am    
ok

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900