|
hi, i'm a newbie in programming. i have problem with calling my Com Object from my asp.net page.Can anyone tell m wat's this error going 2 tell:
Object variable or With block variable not set.
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 variable or With block variable not set.
and my codes is goes up like this : -
<%@ Page ASPCompat="True" %>
<script runat="server">
Dim ObjTx
Dim Cn
Dim ObjNewMember
Dim RsDefault,TravellerType,DefTesting
Sub Page_Load
Cn = Server.CreateObject("ADODB.Connection")
Cn = "DRIVER={SQL Server};SERVER=(local);UID=sa;PWD=;DATABASE=pubs"
ObjNewMember = Server.CreateObject("Hotel.NewMember")
ObjNewMember.CnStr = Cn
RsDefault = Server.CreateObject("ADODB.Recordset")
RsDefault.Open ("Select * from Defaults", Cn)
if not RsDefault.EOF then
TravellerType = RsDefault("DefaultTraveller").Value
end if
Session("STravellerType") = TravellerType
RsDefault.Close()
End Sub
</script>
<form runat=server>
<table>
<tr>
<td>
<% Dim DefTravellerType
DefTravellerType = Session("STravellerType")
%>
<%
ObjTx.ComboTravellerType (CInt(DefTravellerType), "Name='cmbTravellerType' Size='1' Class='dropdown'", "")
%>
</td>
</tr>
</table>
</form>
is that any wrong wif my asp.net code or com object? hopefully can hear fr ur guys soon n solve the problem 4 me..thanx ..
|
|
|
|
|
|
|
|