SV: Request is not available in this context
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngdatagridrepeaterdatalist' list.


=?iso-8859-1?Q?Andr=E9_Colbi=F6rnsen?=
Try this:

Dim strAbstract As String = Context.Request.Form("ABSTRACT")

Hth

Regards/Halsningar

Andre Colbiornsen
--------------------------------------
Sonnenburg Communications
Bergsgatan 3,
SE-211 54 Malmö
Sweden
Tel.: +46-(0)40-97 78 80
Fax.: +46-(0)40-97 78 80
Mob.: +46-(0)708-97 78 79
Mail: Click here to reveal e-mail address
Web.: www.sonnenburg.se
----------------------------------------
B2B Web Solutions - Specializing in .Net
----------------------------------------

-----Ursprungligt meddelande-----
Från: Eric [mailto:Click here to reveal e-mail address]
Skickat: den 24 juli 2002 16:17
Till: aspngDataGridRepeaterDatalist
Ämne: [aspngdatagridrepeaterdatalist] Request is not available in this
context

Hi - All I want to is create a DataGrid based upon the search terms the
user enters but I'm getting the error message:

Request is not available in this context

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Request is not available in
this context

<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "System.Data.SQLClient" %>

<script language="VB" runat="server">

Dim strAbstract As String = Request.Form("ABSTRACT")

Dim SqlText As String = "SELECT tblCatalog.CatalogID, tblCatalog.Title,
tblCatalog.Author, tblCatalog.Publication, tblCatalog.DatePublished,
tblCatalog.CopyrightYear, tblCatalog.Abstract FROM tblCatalog WHERE
((tblCatalog.Title) Like '%" & strAbstract & "%') OR
((tblCatalog.Author) Like '%" & strAbstract & "%') OR
((tblCatalog.Publication) Like '%" & strAbstract & "%') OR
((tblCatalog.Abstract) Like '%" & strAbstract & "%')"

Sub Page_Load
If Not isPostBack Then
BindDataGrid()
End If
End Sub

Sub BindDataGrid

Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim intRecordCount As Integer

MyConnection = New
SqlConnection("server=;database=CatalogSQL;uid=WebUser;password=;")
Dim MyAdapter As New SqlDataAdapter(SqlText, MyConnection)

MyConnection.Open()

ds = new DataSet()
MyAdapter.Fill(ds, "Abstract")
intRecordCount = ds.Tables("Abstract").Rows.Count
TotalRecords.Text = intRecordCount

dgAbstract.DataSource=ds.Tables("Abstract").DefaultView
dgAbstract.DataBind()

MyConnection.Close()

End Sub

</script>

<asp:label id="TotalRecords" runat="server" />
<ASP:DataGrid id="dgAbstract" runat="server" />

| [aspngdatagridrepeaterdatalist] member Click here to reveal e-mail address = YOUR
ID |
http://www.aspfriends.com/aspfriends/aspngdatagridrepeaterdatalist.asp JOIN/QUIT
Reply to this message...
 
    
Eric
that was it. thanks.

-----Original Message-----
From: André Colbiörnsen [mailto:Click here to reveal e-mail address]
Sent: Wednesday, July 24, 2002 11:04 AM
To: aspngDataGridRepeaterDatalist
Subject: [aspngdatagridrepeaterdatalist] SV: Request is not available in
this context

Try this:

Dim strAbstract As String = Context.Request.Form("ABSTRACT")

Hth

Regards/Halsningar

Andre Colbiornsen
--------------------------------------
Sonnenburg Communications
Bergsgatan 3,
SE-211 54 Malmö
Sweden
Tel.: +46-(0)40-97 78 80
Fax.: +46-(0)40-97 78 80
Mob.: +46-(0)708-97 78 79
Mail: Click here to reveal e-mail address
Web.: www.sonnenburg.se
----------------------------------------
B2B Web Solutions - Specializing in .Net
----------------------------------------

-----Ursprungligt meddelande-----
Från: Eric [mailto:Click here to reveal e-mail address]
Skickat: den 24 juli 2002 16:17
Till: aspngDataGridRepeaterDatalist
Ämne: [aspngdatagridrepeaterdatalist] Request is not available in this
context

Hi - All I want to is create a DataGrid based upon the search terms the
user enters but I'm getting the error message:

Request is not available in this context

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Request is not available in
this context

<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "System.Data.SQLClient" %>

<script language="VB" runat="server">

Dim strAbstract As String = Request.Form("ABSTRACT")

Dim SqlText As String = "SELECT tblCatalog.CatalogID, tblCatalog.Title,
tblCatalog.Author, tblCatalog.Publication, tblCatalog.DatePublished,
tblCatalog.CopyrightYear, tblCatalog.Abstract FROM tblCatalog WHERE
((tblCatalog.Title) Like '%" & strAbstract & "%') OR
((tblCatalog.Author) Like '%" & strAbstract & "%') OR
((tblCatalog.Publication) Like '%" & strAbstract & "%') OR
((tblCatalog.Abstract) Like '%" & strAbstract & "%')"

Sub Page_Load
If Not isPostBack Then
BindDataGrid()
End If
End Sub

Sub BindDataGrid

Dim DS As DataSet
Dim MyConnection As SqlConnection
Dim intRecordCount As Integer

MyConnection = New
SqlConnection("server=;database=CatalogSQL;uid=WebUser;password=;")
Dim MyAdapter As New SqlDataAdapter(SqlText, MyConnection)

MyConnection.Open()

ds = new DataSet()
MyAdapter.Fill(ds, "Abstract")
intRecordCount = ds.Tables("Abstract").Rows.Count
TotalRecords.Text = intRecordCount

dgAbstract.DataSource=ds.Tables("Abstract").DefaultView
dgAbstract.DataBind()

MyConnection.Close()

End Sub

</script>

<asp:label id="TotalRecords" runat="server" />
<ASP:DataGrid id="dgAbstract" runat="server" />

| [aspngdatagridrepeaterdatalist] member Click here to reveal e-mail address = YOUR
ID |
http://www.aspfriends.com/aspfriends/aspngdatagridrepeaterdatalist.asp JOIN/QUIT

| [aspngdatagridrepeaterdatalist] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngdatagridrepeaterdatalist.asp
= JOIN/QUIT
Reply to this message...
 
 
System.Data.DataSet
System.Data.SqlClient.SqlConnection
System.Data.SqlClient.SqlDataAdapter
System.Runtime.Remoting.Contexts.Context
System.Web.HttpException
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com