Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 7th, 2007, 01:54 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is .NET 2.0 Framework Required on Web Clients?

First - Please forgive my ignorance, I am very new to web programming with .NET 2.0. In fact I never wrote any applications with 1.1!

So here is my question/issue:
My site is written in .NET 2.0. It has the simple function of quering a database based on the URL that a user is comming in from. So what we have in our DNS server is a listing of URL's all redirecting to one location. My code works fine as long as the web client has .NET 2.0 Framework installed on the machine. So for MACs and Unix machines it won't work, or Windows PC's without .NET 2.0 Framework.

So therefore since .NET code is supposed to be independant of the client, I am sure there is an issue with my code.

Here is my code:

protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack)
   (
     String URL = Request.UrlRefferrer.Host.ToString();
     SqlConnection Conn = new SqlConnection(ConfigurationManager.AppSettings.Get ("DBConnection"));
     SqlCommand Cmd = new SqlCommand();
     Cmd.CommandType = CommandType.Text;
     Conn.Open();
     Cmd.Connection = Conn;
     Cmd.CommandText = "Select * from Profile where WebDNS = '" + URL +"'";

SqlDataReader Reader = Cmd.ExecuteReader();

....then the code fills out the form.

The errors I am getting back are the standard runtime errors with the text, "An application error has occured on the server, change the custom errors..."


Since this is my first .NET 2.0 website outside of book learning, I am lost. Any insight would be helpful.

Thanks,
Joe

 
Old July 7th, 2007, 06:25 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

in your web.config change the Custom errors mode property to off. (In visual studio, double click the web.config and about 3/4ths of the way down the page you will see the custom errors property, flip it to off) This way you can tell us the actual error.

And no, the host machine of a web client does not need the runtime to run your apps.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old July 7th, 2007, 10:23 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by dparsons
 in your web.config change the Custom errors mode property to off. (In visual studio, double click the web.config and about 3/4ths of the way down the page you will see the custom errors property, flip it to off) This way you can tell us the actual error.

And no, the host machine of a web client does not need the runtime to run your apps.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
Thanks - I have done enough support that I was sure I knew that much about .NET.

Here is the actual error-
Object reference not set to an instance of an object.

 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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   _Default.Page_Load(Object sender, EventArgs e) +39
   System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +15
   System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +34
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +47
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061


 
Old July 10th, 2007, 07:50 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hey there.. do you upload the web.config file to the server too?? maybe the stringconnection is null??

looks like there is an object that is null..

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========




Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio .NET 2003 with .NET 2 Framework testsubject VS.NET 2002/2003 1 July 27th, 2006 03:25 PM
running .net apps w/o installing .net framework connect2sandep General .NET 2 June 24th, 2005 04:45 AM
Is it required to upload vti_cnf files...into web? ashokparchuri General .NET 1 May 20th, 2005 09:02 AM
Is .NET framework req. to install .NET application tact_259 VS.NET 2002/2003 2 May 20th, 2004 08:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.