public Tuple <Account_Info, Account_Type> findOneWithType(String id) { String query = String.Format( @"select ai.ID as InfoID, ai.First_Name, ai.Last_Name, ai.Birthday, ai.""Address"", ai.Phone, ai.Note, ai.""Image"", ""at"".ID as 'TypeID', ""at"".""Name"" as 'TypeName' from dbo.Account a, dbo.Account_Info ai, dbo.Account_Type ""at"" where a.Info = ai.ID and a.""Type"" = ""at"".ID and a.Username = N'{0}'", id); var data = DataProvider.getController().ExecuteQuery(query); if (data.Rows.Count > 0) { var data_row = data.Rows[0]; Account_Info account_Info = new Account_Info(); Account_Type account_Type = new Account_Type(); account_Info.ID = (int)data_row.ItemArray[0]; account_Info.First_Name = data_row.ItemArray[1].ToString(); account_Info.Last_Name = data_row.ItemArray[2].ToString(); account_Info.Birthday = (DateTime)data_row.ItemArray[3]; account_Info.Address = data_row.ItemArray[4].ToString(); account_Info.Phone = data_row.ItemArray[5].ToString(); account_Info.Note = data_row.ItemArray[6].ToString(); Bitmap bmp; Console.WriteLine(data_row.ItemArray[7].GetType()); var check = data_row.ItemArray[7].ToString(); if (check != "") { account_Info.Image = HelperUtils.ObjToImg(data_row.ItemArray[7]); } account_Type.ID = int.Parse(data_row.ItemArray[8].ToString()); account_Type.Name = data_row.ItemArray[9].ToString(); return(new Tuple <Account_Info, Account_Type>(account_Info, account_Type)); } return(null); }