Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Lots of Problems.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Lots of Problems.

 Post Reply Post Reply
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: Lots of Problems.
    Posted: 09 November 2005 at 11:16pm
Uggg...So many problems thus far with transferring my app. from ASP.NET 2.0 Beta to 2.0 Final. :-/ Every time I correct an error I'm running into another one.
Any ideas on why this code is throwing an error (it worked fine with beta):
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GridView1.RowDataBound
        ' Sets null cells to more pretty values.
        If e.Row.RowType = DataControlRowType.DataRow Then
            If IsDBNull(e.Row.DataItem("Popularity2")) Then
                e.Row.Cells(3).Text = "-"
            End If
            If IsDBNull(e.Row.DataItem("Popularity")) Then
                e.Row.Cells(4).Text = "-"
            End If
            If IsDBNull(e.Row.DataItem("LastPlayedDate")) Then
                e.Row.Cells(5).Text = "Never"
            End If
        End If
        ' Changes numeric value to text value for presentation purposes.
        Select Case e.Row.Cells(6).Text
            Case 1
                e.Row.Cells(6).Text = "Active Inside"
            Case 2
                e.Row. Cells(6).Text = "Semi-Active Inside"
            Case 3
                e.Row. Cells(6).Text = "Inactive Inside"
            Case 4
                e.Row.Cells(6).Text = "Chair Game"
            Case 5
                e.Row. Cells(6).Text = "Active Outside"
            Case 6
                e.Row. Cells(6).Text = "Semi-Active Outside"
            Case 7
                e.Row. Cells(6).Text = "Inactive Outside"
            Case 8
                e.Row.Cells(6).Text = "Water Game"
            Case 9
                e.Row.Cells(6).Text = "Messy Game"
            Case 10
                e.Row.Cells(6).Text = "Trick "
        End Select
    End Sub
I'm getting a:

Specified argument was out of the range of valid values.
Parameter name: index


David.
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 09 November 2005 at 11:42pm
Well, I haven't figured out the answer, but I do know a bit more about the problem.
I added the line:
Dim test as String = e.Row.Cells(6).Text
And then ran the program again, this allowed me to see that the response is "Nothing" What I don't understand is why e went from holding these values to holding nothing. :-( :-(
David.
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Posted: 10 November 2005 at 10:31pm
I still haven't had any luck with this problem. I discovered however that nearly identical code on a different page works. Maybe it is something with my stored procedure?:
ALTER PROCEDURE dbo.AllGames
    (
    @varAI int,
    @varSI int,
    @varII int,
    @varCG int,
    @varAO int,
    @varSO int,
    @varIO int,
    @varWG int,
    @varMG int,
    @varTrick int,
    @varUserName varchar(200),
    @varSQL varchar(1000),
    @varSearch int
    )
AS
     select uID, gID, LastPlayedDate into #templastplayed from LastPlayed where uID LIKE @varUserName
 select uID as uID2, gID as gID2, Popularity as Popularity2 into #temppopularity from GamePopularity where uID LIKE @varUserName
If @varSearch = 0
BEGIN
     select * from Game G LEFT JOIN #templastplayed LP ON G.ID=LP.gID LEFT JOIN #temppopularity GP ON G.ID=GP.gID2 ORDER BY G.Type
END
If @varSearch = 1
BEGIN
    select * into #tempfilter from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=0
    If @varAI=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=1
    END
    If @varSI=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=2
    END
    If @varII=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=3
    END
    If @varCG=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=4
    END
    If @varAO=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=5
    END
    If @varSO=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=6
    END
    If @varIO=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=7
    END
    If @varWG=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=8
    END
    If @varMG=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=9
    END
    If @varTrick=1
    BEGIN
    Insert Into #tempfilter select * from Game G LEFT JOIN #templastplayed LP on G.ID=LP.gID LEFT JOIN #temppopularity GP on G.ID=GP.gID2 WHERE G.Type=10
    END
    select * from #tempfilter
END
    /* SET NOCOUNT ON */
    RETURN

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.