Asp.net Session Error

B

bob123

Hi again, I am getting this error while converting a page from asp to
asp.net


Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------

Could not create an object of type 'campuscounts_22.general'.
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: Could not create an object of
type 'campuscounts_22.general'.


Stack Trace:

[HttpException (0x80004005): Could not create an object of type
'campuscounts_22.general'.]
Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method
TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags Flags)
+270
Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +371
ASP.default_aspx.__Render__control1(HtmlTextWriter __w, Control
parameterContainer) +359
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter
adapter) +278
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +88


The part of the code is as follows

<%

'response.Buffer = false
if session("school_id") = "" then

'*****************************************************************
session("school_id") = "22"
'*****************************************************************
end if
'response.Write(session("school_id"))

if trim(Request.Form("testsite")) = "Y" then
session("school_id") = "1_test"
session("headerimage") = "_testsite"
end if
%>
<!--#include file="Connections/rs_PAVE_CC_1.aspx" -->
<!--#include file="dbConnect.aspx" -->

This is teh part of code from dbconnect.aspx

dim db_UP, sql, rs
dim db_u, db_p, db_dsn, conn
db_UP = Server.CreateObject("campuscounts_"& session("school_id") &
".general")

conn = Server.CreateObject("ADODB.Connection")

Thanks
 
B

Brendan Reynolds

This forum is for questions about Microsoft Access. I was able to answer
your previous ASP/ASP.NET question because it was a matter of standard VB
syntax that is common to VB classic, VB.NET and VBA, but further questions
about ASP/ASP.NET would be better asked in a more appropriate forum. This is
in your own interest as well as everyone else's - you're more likely to get
a useful answer in a more appropriate forum.

--
Brendan Reynolds (MVP)

bob123 said:
Hi again, I am getting this error while converting a page from asp to
asp.net


Server Error in '/WebSite1' Application.
--------------------------------------------------------------------------------

Could not create an object of type 'campuscounts_22.general'.
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: Could not create an object of
type 'campuscounts_22.general'.


Stack Trace:

[HttpException (0x80004005): Could not create an object of type
'campuscounts_22.general'.]
Microsoft.VisualBasic.CompilerServices.Container.InvokeMethod(Method
TargetProcedure, Object[] Arguments, Boolean[] CopyBack, BindingFlags
Flags) +270
Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object
Instance, Type Type, String MemberName, Object[] Arguments, String[]
ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack) +371
ASP.default_aspx.__Render__control1(HtmlTextWriter __w, Control
parameterContainer) +359
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,
ICollection children) +98
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
System.Web.UI.Page.Render(HtmlTextWriter writer) +27
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,
ControlAdapter adapter) +53
System.Web.UI.Control.RenderControl(HtmlTextWriter writer,
ControlAdapter adapter) +278
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +24
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +88


The part of the code is as follows

<%

'response.Buffer = false
if session("school_id") = "" then

'*****************************************************************
session("school_id") = "22"
'*****************************************************************
end if
'response.Write(session("school_id"))

if trim(Request.Form("testsite")) = "Y" then
session("school_id") = "1_test"
session("headerimage") = "_testsite"
end if
%>
<!--#include file="Connections/rs_PAVE_CC_1.aspx" -->
<!--#include file="dbConnect.aspx" -->

This is teh part of code from dbconnect.aspx

dim db_UP, sql, rs
dim db_u, db_p, db_dsn, conn
db_UP = Server.CreateObject("campuscounts_"& session("school_id") &
".general")

conn = Server.CreateObject("ADODB.Connection")

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

Top