473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

two columns in a listview can be from different tables???

103 100+
say id and name be two columns in a listview,wher both are from two differnt tables,
1st table contains id and name
11nd table contains id and age,11nd table contains ids from first table but not whole ids but half of it...

how can we write the code in vb
Jan 9 '08 #1
9 2376
CyberSoftHari
487 Expert 256MB
Explain your problem detail and no confuse. Are you talking about Inner Join or Left Join Sql queries?
Jan 9 '08 #2
lotus18
866 512MB
say id and name be two columns in a listview,wher both are from two differnt tables,
1st table contains id and name
11nd table contains id and age,11nd table contains ids from first table but not whole ids but half of it...

how can we write the code in vb
This could be done in your query.

Rey Sean
Jan 9 '08 #3
Vbbeginner07
103 100+
Explain your problem detail and no confuse. Are you talking about Inner Join or Left Join Sql queries?
in a single form 2 listview controls,one listview contains....id and name
11nd listview contains work doneby employee(in hours)

in the first listview control,id and name,where id cmes from table say tab1 which has columns id,workdone,gross salary(of emp)
11nd listview control,workdone(in hours)
my doubt occurs here where id can be added from tab1 and i need name to populate from table tab2
tab1-id,name,age
tab2-id,workdone,grosssalary
whereas all ids in tab1 is not there in tab2

thanks in advance
Jan 9 '08 #4
jamesd0142
469 256MB
This could be done in your query.

Rey Sean
Really, i tried this:

"select * from TBLUsers Select * from TBLOther"
and it didnt work
but when i simply use 1 select statemement:
"select * from TBLUsers"
it works fine...

Can you explain by anychance?
Jan 9 '08 #5
CyberSoftHari
487 Expert 256MB
i..
whereas all ids in tab1 is not there in tab2
thanks in advance
I can assume what you are trying,
1. keep tab2 listview empty and fill the tab1 listview1 with your select query (or in your way).
2. when user click tab1 listview (in tab1 listview click event fill tab 2 listview with selected value from tab1 listview) and show tab2 listview.
Jan 9 '08 #6
debasisdas
8,127 Expert 4TB
say id and name be two columns in a listview,wher both are from two differnt tables,
1st table contains id and name
11nd table contains id and age,11nd table contains ids from first table but not whole ids but half of it...

how can we write the code in vb
you need to use JOIN in SQL query to retrive matching data from both the tables
else create a view based on join and select data from the view and populate the listview.
Jan 9 '08 #7
CyberSoftHari
487 Expert 256MB
for the above suggestion we don’t need joins. (Of-course joins and grouping is required but not in this case is it?)
Jan 9 '08 #8
debasisdas
8,127 Expert 4TB
for the above suggestion we don’t need joins. (Of-course joins and grouping is required but not in this case is it?)
Join is required if using only 1 list view.

if want to use two pass the vale from listview1 and pass that to SQL query ,fetch the data and populate the second.
Jan 9 '08 #9
jamesd0142
469 256MB
Join is required if using only 1 list view.
Cheers debasisdas works great now
Jan 9 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Robert Misiak | last post by:
Is it possible to have a different font in individual listView columns? When I do something like: ListViewItem lsi; .... lsi.SubItems.Font = new Font (lsi.SubItems.Font,...
0
by: Samuel R. Neff | last post by:
I'm having a index problem with ListView SubItems. If I add multiple columns to the listview and then add items with associated subitems, the ListView displays fine. Then if I delete a column via...
1
by: Scott Kay | last post by:
Hi, When I use the AllowColumnReorder in the ListView Control, this allows the user to reorder columns by dragging them around. Any items added to the control after the user has reordered them...
3
by: Rob Richardson | last post by:
Greetings! I am attempting to display data in tabular form using a ListView control in detail mode. This is for a program I originally wrote in VB6. In VB6, I would add an item to the...
0
by: CR | last post by:
I'm having a problem with the Listview control. I populated a Listview with 4 columns. On my PC they show up just fine, the right hand edge of the 4th column lines up with the right hand edge of...
3
by: simchajoy2000 | last post by:
Hi, I am trying to use a VB.NET listview object to display information from a datatable. I need to have two columns of information but I don't want the user to be able to select each column...
6
by: Maileen | last post by:
Hi, I have a listview in report mode. I have 3 columns in this listview and 1 column i would like to hide it from user's view. i tried to give width = 0 but user is still able to resize column...
5
by: John Devlon | last post by:
Hi, Does anyone know how to get a value of a second column of a selected item in Listview. I've create a listview and added this code Listview.Items.Clear() Listview.Columns.Clear()...
17
by: vish | last post by:
Hi all, I know this might look strange at first look, but i am looping thru a dataset created using to different tables from database.These two tables have some fields with the same names. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.