Results 1 to 1 of 1

Thread: **RESOLVED*** Newbie Post back problem

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    98

    **RESOLVED*** Newbie Post back problem

    I have a form with 3 radio controls and a button, each radio has it's own sql string defined.
    Data is always returned the first time I choose any option button, but the second time I post it returns a "page cannot be displayed error"
    Thanks in advanced


    Dim strConn as string ="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("Database.mdb") & ";"
    dim strSQL as string
    Dim Conn as New OLEDBConnection(strConn)

    Sub btnShowBugs_Click(sender As Object, e As EventArgs)

    Call DisplayResults(strSQL)

    End Sub


    sub DisplayResults(SQLIN as string)
    on error goto ErrorHandler
    Dim Cmd as New OLEDBCommand(SQLIN,Conn)
    Conn.Open()
    Dim Rdr as OLEDBDataReader
    Rdr=Cmd.ExecuteReader()
    myDataGrid.DataSource = Rdr
    myDataGrid.DataBind()
    Rdr.close()
    Conn.close()


    ErrorHandler:
    if err.number<>0 then
    response.write (err.description)
    end if



    end sub



    Sub rd_SQL_BUGID_CheckedChanged(sender As Object, e As EventArgs)
    strSQL ="select BugId from Product order by BugId"
    End Sub

    Sub rd_SQL_PRODUCTNAME_CheckedChanged(sender As Object, e As EventArgs)
    strSQL ="select ProductName from Product"
    End Sub

    Sub rd_SQL_ALL_CheckedChanged(sender As Object, e As EventArgs)
    strSQL ="select * from Product order by BugId"
    End Sub

    Update:This seems to be the error.
    System.Web.HttpException: The View State is invalid for this page and might be corrupted



    RESOLVED: I turned EnableViewState to False on the DataGrid Control.
    Last edited by Incognito44; Mar 19th, 2003 at 06:55 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width