Object reference not set to an instance of an object??

R

Reapes

Hi Group,

I wonder if any smart people out there can help me ...

I keep gettng Object reference not set to an instance of an object whenever
I run my aspx page.

I cannot understand why I keep getting this as a while ago this page worked
fine with as far as I can tell no modifications. I have underlined the line
where it throws the exception. I am using DreamweaverMX's Datasets if that
makes any difference :)

I have included the code down to the error line if that helps...

Thanks

<!-- #include file="nocache.asp" -->
<!-- #include file="BasketTotal.aspx" -->
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1"
debug="true" %>
<%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls"
Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral"
%>
<MM:DataSet
id="dbMenu"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_CMC")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_CMC")
%>'
CommandText='<%# "SELECT
categoryID,CatLink,subcategoryid=0,name=categoryname FROM category union
all select categoryid,CatLink,subcategoryid,name=subcategoryname from
subcategory ORDER BY categoryid,subcategoryid" %>'
Debug="true"
</MM:DataSet>
<MM:DataSet
id="QryBasketItems"
runat="Server"
IsStoredProcedure="false"
ConnectionString='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_CMC")
%>'
DatabaseType='<%#
System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_CMC")
%>'
CommandText='<%# "SELECT COUNT(DISTINCT(sku)) AS TOTALSKUS FROM
dbo.basket_detail INNER JOIN dbo.Basket ON dbo.Basket.Basket_id =
dbo.Basket_detail.Basket_id WHERE dbo.Basket.Shopper_ID =shopper_id" %>'
Debug="true"
<Parameters>
<Parameter Name="@shopper_id" Value='<%# IIf((Not
Request.Cookies("shopGuid")("Guid") Is Nothing), Request.Cookies(IIf((Not
Request.Cookies("shopGuid")("Guid") Is
 
K

Karl

Quickly looking at it, my guess is that Request.Cookies("shopGuid") doesn't
exist, so when you try to access the "Guid" value of something that doesn't
exist, it's crashing.

You should check to make sure Request.Cookies("shopGuid") isn't nothing
before tryin to do anything to it..

Karl
 
R

Reapes

Ok Found it !

removed the hash from the line : <%# to <% and it works fine again. Why DWMX
puts this in I don't know..

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top