Click here to Skip to main content
14,388,661 members
Rate this:
Please Sign up or sign in to vote.
See more: , +
Hi every one I have two table Photogallary and images, i insert the image ,imagellocation and imageid in images table, and in Photocategory i insert imageid and imagecategory. i want to display these image details on the front page with the help of datalist.

Problem: I want to display imagecategory from the photocategory table, but the  problem is that how can we merge two tables data in a single datalist,
I need query for this problem, i think there i need inner join related query.
Can any one help me please..

Thanks in advance...
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

I think you know the solution, you need to use Joins in SQL query. If you have problem in syntax of inner join, so this could help.

SELECT column_name(s)
FROM table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name


You can also refer,

http://www.w3schools.com/sql/sql_join_inner.asp[^]
   
Comments
ManavGuru 24-Nov-11 2:44am
   
I need query, i only guess may be i can use join query
Rate this:
Please Sign up or sign in to vote.

Solution 2

Similar question 2 hours ago Read the Dataset in asp.net combine two tables[^]
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

USE [UDJTC]
GO
/****** Object:  StoredProcedure [dbo].[usp_GetFeaturedMemberDetailPi]    Script Date: 11/24/2011 10:21:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER Proc [dbo].[usp_GetFeaturedMemberDetailPi]

AS
with a as
(
select *, CHARINDEX('/', Reg_No)+1 c   from LM_commiteemember
), b as
(
select *, CHARINDEX('/', Reg_No, c)-1 d   from a
)
, d as
(
select * , SUBSTRING(Reg_No, 1, c-2) f, cast(SUBSTRING(Reg_No, c, d-c+1) as int) e   from b
)
select * from d order by f, e
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100