Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two tables(namely tblperson and tbljob) and also I have a gridview. I want to display in my gridview all the records from tblperson and one field in tbljob. They do not have any key to form...


I am a beginner in ASP.Net. This is the scenario I am facing today in creating this project. Please someone help me. Thanks :)
Posted
Updated 9-Jul-14 17:36pm
v2
Comments
DamithSL 9-Jul-14 23:00pm    
don't put everything in question title, explain in the body of the question
ArunRajendra 9-Jul-14 23:03pm    
I guess you don't have a relation between the two table if so its not possible. You need to have relation between the two tables.
DamithSL 9-Jul-14 23:17pm    
what is your database and the version?
DarkDreamer08 9-Jul-14 23:29pm    
I am sorry about that. It's just my second time to post question here.

SQL SERVER 2008 R2
Prasad Avunoori 9-Jul-14 23:37pm    
Can you please post your two tables column names and expected result set?

Hi,

Use below Query

SQL
Select tblPerson.*, tblJob.Field1 from tblPerson, tblJob where -- Use condition, if you want.


It is Cross join without relation, use this and if you have any confusion then you can ask me.
 
Share this answer
 
if there is no relation ,the joins will be not possible but you can use the union or union all to show the records from 2 diff table, but it will display in row by row....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900