djclipz 0 Newbie Poster

First of all this is an example of soemthing i am trying to do, but the idea is the same as what i want to acheive.

Ok my problem is, i am filling a listbox control with data from two tables.

eg.
Table A

  • A_Id

  • desc

  • total

Table B

  • B_Id

  • desc

  • total

This i have acheived with the use of a union in the sql. The problem i have is, i then want the DataValueField to be set as the id of the item selected for when i click save. However the primary key names have different names. Is there a way i can select the primary key id as the datavaluefield, because at the minute i can only use the total field but the problem with this is i have no idea what table the data has come from so i need the id of the table to be saved. But obviously setting the DataValueField as A_Id doesn't work and you can't have two as far as i know.

Thanks