Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2006

Tip: Looking for answers? Try searching our database.

Server Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
majo - 15 Mar 2006 01:27 GMT
Hi,

I had posted this once earlier, but couldnt get my problem solved.
When i run an asp.net application in windows 2003 server with IIS 6.0, it
"SOMETIMES" gives me the below given error. Please note that it gives this
error only ONCE IN A WHILE.

To test if this error has anything to do with the server, I xcopied the same
application to a new virtual directory in the same server.

When i was getting the server error in the first application, i tried
running the application in the virtual directory. It worked well without any
error.

I assume that it has something to do with the concurrent user settings. can
anybody help please.

Thanks in advance,
Majo

*--------------------------------------

Server Error in '/CreditApplication' Application.
________________________________________
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.

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 variable or With block variable not set.]

Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type
objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
+934

Extraction.ViewApplication.LocContracts() in
D:\CreditApplication-1.0H\ViewApplication\ViewApplicationExtraction.aspx.vb:396

Extraction.ViewApplication.Page_Load(Object sender, EventArgs e) in
D:\CreditApplication-1.0H\ViewApplication\ViewApplicationExtraction.aspx.vb:54

System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
________________________________________
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300

*--------------------------------------
Kevin Spencer - 15 Mar 2006 13:30 GMT
Did you look at ViewApplicationExtraction.aspx.vb:396

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

> Hi,
>
[quoted text clipped - 61 lines]
>
> *--------------------------------------
majo - 15 Mar 2006 22:52 GMT
Hi kevin,

Thanks for your reply.
My code is given below

*--------------------------------------

   Private Sub LocContracts()
       Dim OnlineConnection As New OnlineConnection
       Dim Sql, SqlComm, SqlDR

       Dim Branch = "ABHN"

       Dim DBConnection = OnlineConnection.OnlineDBConnection
       (Database)
       Dim Trans As SqlClient.SqlTransaction =
       DBConnection.BeginTransaction(IsolationLevel.ReadCommitted)
       Sql = "Update Applications Set ContractType = 5,Repayment =
       Case "
       Sql = Sql & " when (LoanAmount * 3 / 100) > 40 Then
       (LoanAmount * 3 /100)"
       Sql = Sql & " else 40 End "
       Sql = Sql & " where BranchId in ( Select BranchId from Branch
       where BranchName = '" & Branch & "')"
       Sql = Sql & " And ContractType = 0"

       SqlComm = New SqlCommand(Sql, DBConnection)
       SqlComm.Transaction = Trans
       SqlDR = SqlComm.ExecuteReader()
       Trans.Commit()

       SqlDR.Close()
       SqlComm = Nothing
       Sql = Nothing
       OnlineConnection = Nothing

   End Sub

*--------------------------------------
In this code, Line 396 is given below.

Dim Trans As SqlClient.SqlTransaction =
       DBConnection.BeginTransaction(IsolationLevel.ReadCommitted)

Hope you can sort this out.
Thanks,
Majo

> Did you look at ViewApplicationExtraction.aspx.vb:396
>
[quoted text clipped - 63 lines]
> >
> > *--------------------------------------
Kevin Spencer - 16 Mar 2006 12:56 GMT
Hi majo,

Dim Trans As SqlClient.SqlTransaction =
       DBConnection.BeginTransaction(IsolationLevel.ReadCommitted)

I would suspect that DBConnection is Nothing when this exception occurs.
Make sure that it is always created beforehand. If you are sure that it is
always created, it is possible that something has caused the connection to
the database to be interrupted.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

> Hi kevin,
>
[quoted text clipped - 119 lines]
>> >
>> > *--------------------------------------
majo - 17 Mar 2006 02:01 GMT
Hi kevin

Iam sure that DBConnection is always created beforehand.
Can you tell me the possible causes for the connection to get interrupted ?

Rgds,
Majo.

> Hi majo,
>
[quoted text clipped - 129 lines]
> >> >
> >> > *--------------------------------------

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.