string sql="", sql2 = "", rank="";
int basic_wage, rent_allowance, seniority_allowance, overtime_rate;
sql += "select rank, Basic_Wage,Rent_Allowance,Seniority_Allowance,Overtime_rate from Designation_Details where Designation_ID=(select Designation_ID from Officer where Member_ID=" + id + ")";
sql2 += "select Overtime_Hours from Officer where Member_ID=" + id;
DataTable dtable1 = DataAccess.GetDataTable(sql);
DataTable dtable2 = DataAccess.GetDataTable(sql2);
rank+=dtable1.Rows[0].ItemArray[0];
basic_wage = dtable1.Rows[0].ItemArray[1];
rent_allowance = dtable1.Rows[0].ItemArray[2];
seniority_allowance = dtable1.Rows[0].ItemArray[3];
overtime_rate = dtable1.Rows[0].ItemArray[4];
bBasic_Wage
,Rent_Allowance
,Seniority_Allowance
, and Overtime_rate
are all int data types in the table.
The error message says:
....cannot implicitly convert object to int. An explicit conversion exists...