Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 May 5th, 2006, 02:13 AM
Registered User
 
Join Date: Mar 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Vhat does this exception mean?!

A few times, our website has gone down throwing the following exception:

System.InvalidOperationException: ExecuteReader: Connection property has not been initialized. at System.Data.SqlClient.SqlCommand.ValidateCommand(S tring method, Boolean executing) at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior) at subibl.DBUtil.ExecuteSP(Object[,] arr, String spName, SqlConnection cn)

where the ExecuteSP function looks like this:

Public Shared Function ExecuteSP(ByVal arr(,) As Object, ByVal spName As String, ByVal cn As SqlConnection)
        Dim cmd As New SqlCommand(spName, cn)
        Dim reader As SqlDataReader
        Dim i, j As Integer
        Try
            cmd.CommandType = CommandType.StoredProcedure
            For i = 0 To arr.GetUpperBound(0)
                cmd.Parameters.Add(arr(i, 0), arr(i, 1))
            Next
            reader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
            Return reader
            cmd = Nothing
            reader = Nothing
        Catch ex As Exception
            System.Web.HttpContext.Current.Response.Write(ex.T oString)
            System.Web.HttpContext.Current.Response.End()
        End Try
    End Function

Obviously, there is some kind of connection problem to the SQL server. The strange thing is that it occurs without us having done anything, and a few minutes later, perhaps 5-10 minutes, it's up and running again, all by itself. We have checked the event viewer and error logs for clues but nothing.

Any suggestions what can be causing this problem?






Similar Threads
Thread Thread Starter Forum Replies Last Post
COM Exception muralidharan.d VS.NET 2002/2003 0 August 7th, 2007 02:49 PM
Exception when transforming using ksskumar XSLT 1 October 10th, 2006 02:33 AM
Exception Ochi C# 1 January 15th, 2006 11:38 PM
Security exception akibaMaila VB.NET 2002/2003 Basics 3 June 30th, 2005 01:29 PM
Security Exception skyler ASP.NET 1.0 and 1.1 Professional 0 June 24th, 2005 12:47 AM





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