How To Join Two Tables Data Into UITableView Using Sqlite IPhone And How To Set NSDictionary Object?
How to join my two tables data into another screen in this Am Struck with the NSDictionary,NSArray and NSString how to add object into NSDictionary? Below is my DBClass.m #imp
Solution 1:
In your getdata method, your sql is asking for EMP_ID, Age, DEPT, but you're storing the data as Emp_ID, Name, Dept. One says age, the other says name. Also, you're duplicating the column numbers, getting a value from column 2, which would be DEPT, and you're storing it in Emp_ID, and you're getting the value from column 1 twice, which would be age, and storing it in Name and Dept. Column 0 should be Emp_ID, 1 is Age (which you probably want to change to Name), 2 is DEPT.
You can also simplify your SQL statement a bit with:
SELECT EMP_ID, Age, DEPT FROM COMPANY, DEPARTMENT where COMPANY.ID = DEPARTMENT.EMP_ID;
Post a Comment for "How To Join Two Tables Data Into UITableView Using Sqlite IPhone And How To Set NSDictionary Object?"