The ConnectionString property has not been initialized.

Discussion in 'ASP.NET 2.0' started by JanLimpens, Mar 28, 2007.

  1. Hello,

    I receive a lot of these:
    Error @ URI: /Category.aspx?CategoryID=3

    InvalidOperationException: 'The ConnectionString property has not been initialized.'
    at System.Data.SqlClient.SqlConnection.PermissionDemand()
    at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at FestaExpress.Data.SqlServer.DataSetSessionsTableAdapters.TempShoppingCartTableAdapter.CountUserOrders(Guid cookieID) in E:\usr\jan\My Documents\Visual Studio 2005\Projects\Festaexpress\FestaExpress.Data.SqlServer\DataSetSessions.Designer.cs:line 1083
    at ShoppingCartHelper.GetItemCount(Guid cookieID)
    at FestaExpress.Web.Site.ShoppingCart.GetItemCount()

    GetItemCount() is a method that returns the result from a scalar sql query to sqlserver2005 from a dataset/tableadapter. The dataset is in an external dll, I use from a static method in the web site's app_code folder. There are many different Query/Methods in this Dataadapter, using the same connection properties and never fail.
    When inspecting the (generated) code I do not see anything suspicious there. And of course here on my development machines, this exception has never happened.

    Anyone any ideas?

    Thanks,
    Jan
     

Share This Page