www.webdeveloper.com
Results 1 to 5 of 5

Thread: ASP Repeater Null Values

  1. #1
    Join Date
    Apr 2005
    Posts
    44

    ASP Repeater Null Values

    Hi everyone, I currently have the following repeater which is working perfectly.

    HTML Code:
    <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.

  2. #2
    Join Date
    Apr 2005
    Posts
    44
    Any ideas anyone ?

  3. #3
    Join Date
    Dec 2007
    Posts
    15
    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

  4. #4
    Join Date
    Apr 2005
    Posts
    44
    Here is my SQL query :

    Code:
    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.

  5. #5
    Join Date
    Dec 2007
    Posts
    15
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles