Last post Sep 26, 2007 04:59 PM by landshark
Sep 25, 2007 07:41 PM|landshark|LINK
I keep getting the "...'Request' could not be found..." error in VS 2003 when trying to compile code containing the following snippet:
1 using System;
2 using System.Web;
3 using System.Data;
4 using System.Data.SqlClient;
5 using System.Xml;
6 using StringFunctions;
8 namespace Main_Data_Object
12 public BaseDataObject()
void AuditMe(string ExecutedSQL)
18 string strUserID;
22 strUserID = Request.ServerVariables["REMOTE_USER"].Replace("FOO\\",
I have dug around on the web without much luck. MSDN says this is in the System.Web namespace, but when I interrogate System.Web I only see AspNetHostingPermission properties.
Does anyone know what I am doing wrong?
Sep 25, 2007 10:51 PM|mbanavige|LINK
Sounds like you are working in a library project and have not yet added a reference to the System.Web assembly.
The Using directive does not create the reference, it simply gets you easier access to the types in a namespace. You'll still need to add the reference.
Sep 26, 2007 04:59 PM|landshark|LINK
Heya, Mike :-) I like your Avatar Avatar [:P]
Ok, so you got me on the right track, thank you :-) The complete solution was that I needed to not only include System.Web in the project, but I needed to reform my SystemVariables interrogation: