Click to See Complete Forum and Search --> : ASP Repeater Null Values


seafordcrownfc
01-02-2008, 11:03 AM
Hi everyone, I currently have the following repeater which is working perfectly.

<asp:Repeater ID="Repeater4" runat="server" DataSourceID="AccessDataSource4" >
<ItemTemplate>
Goals : <%# Eval ("goals") %>
</ItemTemplate>
</asp:Repeater>

At the moment it returns Goals : then the number e.g.
Goals : 2
Goals : 31

But if a player has '0' Goals it returns ...

Goals :

A blank space. How do I make it so that if a player does have 0 goals, then the number '0' is displayed ?

Thanks in advance.

Happy New Year.

seafordcrownfc
01-17-2008, 07:07 AM
Any ideas anyone ?

vamsi616
01-17-2008, 09:16 AM
Hi,

We can achieve that from SQL query only, i am sending a small query, hope it helps, if not post your query

SELECT ISNULL(goaltotal, 0) AS 'Goal' FROM tblGoals_Master

seafordcrownfc
01-17-2008, 11:30 AM
Here is my SQL query :

SELECT top 1 p.playerID, p.playername,
sum(pme.start)*-1 AS Starts,
sum(pme.sub)*-1 AS Subs,
sum(pme.goals) AS goals,
p.picture, p.favouriteposition
FROM player AS p, playermatchevents AS pme, stfcmatch AS sm, season AS s


Thanks.

vamsi616
01-18-2008, 06:13 AM
SELECT top 1 p.playerID, p.playername,
sum(pme.start)*-1 AS Starts,
sum(pme.sub)*-1 AS Subs,
ISNULL(sum(pme.goals),0) AS goals,
p.picture, p.favouriteposition
FROM player AS p, playermatchevents AS pme, stfcmatch AS sm, season AS s


Check once, hope it works