filling a listbox with two tables and saving datavalue field

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 4
Reputation: djclipz is an unknown quantity at this point 
Solved Threads: 0
djclipz djclipz is offline Offline
Newbie Poster

filling a listbox with two tables and saving datavalue field

 
0
  #1
Aug 7th, 2008
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC