.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

System.ObjectDisposedException: Cannot access a disposed object.Object name: 'MQCacheableInfo'.

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :.NET Framework


I am using MSMQ concept in my .Net windows service application. So, i got below mentioned error and messages are moved to UnHandled queue. If i process manually then message has been processed well. So, this issue we got quite common on my production environment. I would like to know whether can we fix this issue.

Exception Message:

2010-10-05 01:37:03,687 [Handler.1] WARN  HandlerService.CWorkerThread - Couldn't process message

System.ObjectDisposedException: Cannot access a disposed object.Object name: 'MQCacheableInfo'.

   at System.Messaging.MessageQueue.MQCacheableInfo.get_WriteHandle()

   at System.Messaging.MessageQueue.StaleSafeSendMessage(MQPROPS properties, IntPtr transaction)

View Complete Post

More Related Resource Links

Regarding "Cannot access disposed Object name:Transaction" DTC error in SQL server 2008


Hi all,

I have upgraded  my Sql server 2005 to Sql server 2008 in window 2003 server (SP 2 standard edition) . After upgrading  iam getting above mentioned MSDTC issue when try to make an distributed transaction with Sql server 2008 in my .Net application .

Note: No issues with SQL server 2005...

Please give me an solution

A Young Person's Guide to The Simple Object Access Protocol: SOAP Increases Interoperability Across


The Simple Object Access Protocol (SOAP) facilitates interoperability among a wide range of programs and platforms, making existing applications accessible to a broader range of users. SOAP combines the proven Web technology of HTTP with the flexibility and extensibility of XML. This article takes you on a comprehensive tour of Object RPC technology to help you understand the foundations of SOAP and the ways it overcomes many of the limitations of existing technologies, including DCOM and CORBA. This is followed by a detailed treatment of the SOAP encoding rules with a focus on how SOAP maps onto existing ORPC concepts.

Don Box

MSDN Magazine March 2000

Build an Easy Maintenance Intranet Site: Using Office Docs, File System Object, and OLE Structured S


If you've ever needed to build an easy-to-maintain intranet site, here's a solution based on Microsoft Office documents. Many sites require constant updating of their HTML, but the use of Word documents can simplify the process. This article details the construction of a human resources site that exploits the File System Object (FSO), OLE Structured Storage, and ActiveX capabilities of Word documents. This allows the HR staff to copy their revised or newly created Word files to the site, dynamically generate a list of links to their files, and free IS from the constant recoding of HR updates into new HTML pages.

Josef Finsel

MSDN Magazine March 2000

Unable to cast object of type 'System.Web.Mvc.ValueProviderResult' to type 'System.IConvertible'


 Why am I getting this error on line:

               sp.Price = Convert.ToDecimal(collection.GetValue("Price"));

sp is :
  SPecials_Templates sp = new SPecials_Templates();

SPecials_Templates Defined:

    public partial class SPecials_Templates
        public class SPecials_TemplatesMetaData

            public object Key { get; set; }
            public object Template_Name { get; set; }
            public object Headline { get; set; }

How to Cache System.Collection.Generic.List object


I need to cache System.Collection.Generic.List object with expiration time

var Root = from feed in feedhotel.Descendants(ota + "HotelContent")
                           where (feed.Attribute("HotelCode") != null)
                           select new xmlhotel()




return Root.ToList();

Is it possible to cache Root.ToList() for some time....

How to access the refrenced table fields in Ilist object of table MVC asp.net



I have 2 tables, master, detail. 1.master table have fields (id, username, plan)-->id is primary key (PK) 2. detail table have fields (srNo,id, worksummary, ... )--> srNo is PK.

I have created foreign key relationship from detail to .master table for "id" field.

the code is:

IList<detail> objDetail=new List<detail> (); 
IList<master> objMaster = new List<master> ();
string[] sarray = queryFields.Split('|');//

for (int i = 0; i < sarray.Length; i++)
string[] sfields = sarray[i].Split(',');

if (sfields[0] != "")

objDetail.Add(new _detail { Id = count , modify = sfields[1].ToString(), verified = sfields[2], I});


I have problem to add fields in "objDetail" using Add method. But I am unable to access the reference field "Id" , rest of the field of detail table can be accessed using objDetail.

How can I access the "Id" field from objDetail object to add in IList.

I want to solve this problem

Cannot access Label inside Repeater - "Object reference not set..."


I have a button on a page with a Repeater and an ObjectDataSource. To give credit where credit is due, the Repeater's paging functionality is courtesy of ScottGu. (However, I'm using ASP.NET 4.0 and SQL Server 2008, as opposed to ASP.NET 2.0 and SQL Server 2005.)

Anyway, in the button's click event, I need to access the Text property of a Label that's inside the Repeater because it's used as an input parameter in a stored procedure. I'm getting a NullReferenceException when trying to access the Label's Text property. I have researched this error and have tried a few different solutions (involving FindControl and the Repeater's ItemDataBound event), but I haven't been able to get it to work. Any suggestions, in VB or C#, would be greatly appreciated. The code is below.


<asp:Repeater ID="rptText" runat="server" DataSourceID="tbsDataSource">
<table width="100%" cellspacing="1">
<%-- some rows removed for brevity --%>

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Object canno

hello,i am using a web servicewrtitten in .net and i access the webservice from my wepApplication i get this error System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Object cannot be cast from DBNull to other types.my code is access webservice: protected void btnSave_Click(object sender, EventArgs e)        {            int intStatusCode;            dtProjectStatus = (DataTable)ViewState["dtProjectStatus"];            try            {                objService.Credentials = System.Net.CredentialCache.DefaultCredentials;                if(dtProjectStatus.Rows.Count>0)                {                  intStatusCode = objService.InsertTest(dtProjectStatus);                }   

Object Cache set with Portal Super User accounts. Access denied to site.

I have the same issue on multiple farms. In this example i'll outline this problem for a three tier farm. SharePoint web server SharePoint Application server (hosts central admin) Sql server After installation and configuration i have created two web applications (claims based auth with NTLM). https://portal.contoso.com https://mysite.contoso.com The client connects on the URLs to the web server (1st tier). All is working correctly and they can access the portal and their mysite. The log file keeps reporting that i need to configure the user accounts for the Object Chache. So, i looked up the required steps and executed these conform mcrosoft guidelines (http://technet.microsoft.com/en-us/library/ff758656.aspx) All the steps run seccesfully. But when i connect to the URL i now get an access denied (even with the administrator who is site collection administrator) In the log file i get the following to lines when i connect to the site. Unknown SPRequest error occurred. More information: 0x80070002 Unknown SPRequest error occurred. More information: 0x80070005 I have exact the same issue on two other farms. Marc

System.NullReferenceException: Object reference not set to an instance of an object

        BVWS.Vardering oWS = new BVWS.Vardering();        BVWS.strucBPVardering oSvar1 = new BVWS.strucBPVardering();        BVWS.StrucPaket oPaket = new BVWS.StrucPaket();                 if (Page.IsPostBack)        {             oSvar1 = oWS.BpVardering("", "", regnummer.Text, "2000", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", DropDownList1.SelectedValue);      tdCHK1.Visible = false;                  try            {                if (oSvar1.rubst01.Length > 0)                {                   

Converting a System.Windows.Control.Image object to byte array.

Hi i need to convert a specific System.Windows.Control.Image object into an (int) array, because i'm trying to convert a silverlight application into a wpf project. private void createGi02GradBrush()<br/> {<br/> WriteableBitmap oWriteableBitmap = new WriteableBitmap(256, 256);<br/> Image oImage = new Image();<br/> oImage.Arrange(new Rect(0, 0, 256, 256));<br/> oImage.Measure(new Size(256, 256));<br/> oImage.Source = new WriteableBitmap(256, 256);<br/> Gi02GradShaderEffect oGi02GradShaderEffect = new Gi02GradShaderEffect();<br/> oGi02GradShaderEffect.pArray = oPImageBrush;<br/> oGi02GradShaderEffect.gi1GradArray = oGi1GradImageBrush;<br/> oImage.Effect = oGi02GradShaderEffect;<br/> oWriteableBitmap.Render(oImage, null);//here<br/> oWriteableBitmap.Invalidate(); <br/> this.oGi02GradImageBrush = new ImageBrush();<br/> this.oGi02GradImageBrush.ImageSource = oWriteableBitmap;<br/> } I've found some similar topics however Image object is not the same and most of its methods aren't available. Here I'm rendering a writablebitmap with a given Image object, but in wpf we need an array. oWriteableBitmap.Render(oImage, null); Any idea? Thanks. Joseph.  

The calling thread cannot access this object because a different thread owns it.

this is my code I want to put the win.show in another thread but win object in the main thread. because I need to do some verification to the win.content in main thread when the win ui is refreshing in another thread. however, I hit the exception The calling thread cannot access this object because a different thread owns it.   namespace ConsoleApplication1 {     public delegate void AsyncDelegate();     public class Program     {                 [STAThread]         static void Main(string[] args)         {             Window win = new Window();                        AsyncDelegate call = new AsyncDelegate(()=>win.Show());             call.BeginInvoke(null, null);                     }             }     }

Unable to cast COM object of type 'System.__ComObject' to interface type 'IRowset'


No mapping exists from object type System.Web.UI.WebControls.Label to a known managed provider nativ

 I'm making the leap to move from vb.net to C#, and I'm getting this crazy error when I try to execute one sp, set a value, and then execute another sp based on the value.   Any suggestions??? proc_GetSectionDetails is my first stored procedure.  From that, I get a value for SectionID, and then use it for the second sp called  proc_GetSectionDetails protected void getSectionContent() { SqlConnection conn = default(SqlConnection); SqlCommand comm = default(SqlCommand); SqlDataReader reader = default(SqlDataReader); string connectionString = ConfigurationManager.ConnectionStrings["123"].ConnectionString; conn = new SqlConnection(connectionString); comm = new SqlCommand(); comm.Connection = conn; comm.CommandType = System.Data.CommandType.StoredProcedure; comm.CommandText = "proc_GetSectionDetails"; comm.Parameters.AddWithValue("SubSectionID", Request.QueryString["SubSectionID"]); conn.Open(); reader = comm.ExecuteReader(); if (reader.Read()) { lblName.Text = Convert.ToString(reader["SubSectionName"]); lblDesc.Text = Convert.ToString(reader["SubSectionDescription"]); Label SubSectionParentID = new Label();

System.NullReferenceException: Object reference not set to an instance of an object.

I am working on a Windows 7 professional machine, 64bit,  to learn SQL server 2008.   i'm working with the microsoft sql server 2008 step by step book and i'm stck on configuring email notificaions. i've already goe through the GUI to configure my email settings. however, sql server agent is disabled. when i try to start the service i get the following error: Unhandled exception has occurred in your application....... Object reference not set to an instance of an object. Here are the details of the error message: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.NullReferenceException: Object reference not set to an instance of an object. Server stack trace:    at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.FindObjectExplorerFrame()    at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.GetObjectExplorer(Boolean activateWindow)    at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ShowError(Exception e)    at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.Service.Start()    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, In

Cannot add content to object of type 'System.Windows.Navigation.NavigationWindow'

Hello, i'm trying to add content to a custom class inherited from System.Windows.Navigation.NavigationWindow but i receive the following error: Cannot add content to object of type 'System.Windows.Navigation.NavigationWindow' This is the XAML of my Window: <NavigationWindow x:Class="Obolus.Windows.MainWindow"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="..."     Style="{StaticResource MainWindowStyle}" ContentRendered="NavigationWindow_ContentRendered" >     <Grid></Grid>     </NavigationWindow> what i want is drawing shapes in this window, which will act as container and background for a lot of pages inside. It will be a classic Wizard. In .Net Windows Forms i override the OnPaint method of any control, and i draw all the things programatically. I don't know hot to do it in WPF. ¿Adding shape contents to the window? ¿overriding OnContentRendered? ¿any idea? Thanks in advance, Best regards, Raúl Truco,  

Unable to cast object of type 'System.Guid' to type 'System.String'.

protected void Button1_Click(object sender, EventArgs e) { using (BurnbetDataContext dc = new BurnbetDataContext()) { var q = (from c in dc.GetTable<tbl_Payment>() where c.ID == 5 select c).Single<tbl_Payment>(); dc.GetTable<tbl_Payment>().DeleteOnSubmit(q); dc.SubmitChanges(); } } }System.InvalidCastException was unhandled by user code  Message=Unable to cast object of type 'System.Guid' to type 'System.String'.  Source=System.Data.Linq  StackTrace:       at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)       at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)       at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)       at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)&nb
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend