473,704 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"COM object that has been separated from its underlying RCW cannot be used."

(I posted this in the ADO.NET NG, but didn't get any responses)

I've started getting this exception since installing vs2005
"COM object that has been separated from its underlying RCW cannot be used."
The code this is causing the exception is:
<code>
try
{
m_command.Comma ndText = GetAccessSprocS tring(m_spDelet eProtocol);
m_command.Param eters.Clear();
OleDbParameter param = new OleDbParameter( "_protocolI D",
protocol.Protoc olID);
m_command.Param eters.Add(param );

// open the connection and execute the update
m_connection.Op en();
m_command.Execu teNonQuery(); // THIS IS THE LINE THAT CAUSES
THE EXCEPTION
}
catch (OleDbException e)
{
m_log.LogError( e.Message, new StackFrame(true ));
}
catch (Exception ee)
{
m_log.LogError( ee.Message, new StackFrame(true ));
}
finally
{
m_connection.Cl ose();
}
</code>
I honestly can't tell what is doing this. Googling hasn't shed much light.
Anyone know common causes for this exception?
Thanks for any help,
Steve
Dec 20 '05 #1
2 8126
Steve,

I would try and create the connection object once in the method itself,
and not store it on the class level as a field.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Steve" <ss*@sss.com> wrote in message
news:Oi******** ******@TK2MSFTN GP12.phx.gbl...
(I posted this in the ADO.NET NG, but didn't get any responses)

I've started getting this exception since installing vs2005
"COM object that has been separated from its underlying RCW cannot be
used."
The code this is causing the exception is:
<code>
try
{
m_command.Comma ndText = GetAccessSprocS tring(m_spDelet eProtocol);
m_command.Param eters.Clear();
OleDbParameter param = new OleDbParameter( "_protocolI D",
protocol.Protoc olID);
m_command.Param eters.Add(param );

// open the connection and execute the update
m_connection.Op en();
m_command.Execu teNonQuery(); // THIS IS THE LINE THAT
CAUSES
THE EXCEPTION
}
catch (OleDbException e)
{
m_log.LogError( e.Message, new StackFrame(true ));
}
catch (Exception ee)
{
m_log.LogError( ee.Message, new StackFrame(true ));
}
finally
{
m_connection.Cl ose();
}
</code>
I honestly can't tell what is doing this. Googling hasn't shed much
light.
Anyone know common causes for this exception?
Thanks for any help,
Steve

Dec 20 '05 #2
Hi Nicholas,

OK, I tried that and I still get the exception. Very weird. I can't really
find much on google either. Any other ideas?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:OE******** ******@TK2MSFTN GP10.phx.gbl...
Steve,

I would try and create the connection object once in the method itself,
and not store it on the class level as a field.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Steve" <ss*@sss.com> wrote in message
news:Oi******** ******@TK2MSFTN GP12.phx.gbl...
(I posted this in the ADO.NET NG, but didn't get any responses)

I've started getting this exception since installing vs2005
"COM object that has been separated from its underlying RCW cannot be
used."
The code this is causing the exception is:
<code>
try
{
m_command.Comma ndText = GetAccessSprocS tring(m_spDelet eProtocol);
m_command.Param eters.Clear();
OleDbParameter param = new OleDbParameter( "_protocolI D",
protocol.Protoc olID);
m_command.Param eters.Add(param );

// open the connection and execute the update
m_connection.Op en();
m_command.Execu teNonQuery(); // THIS IS THE LINE THAT
CAUSES
THE EXCEPTION
}
catch (OleDbException e)
{
m_log.LogError( e.Message, new StackFrame(true ));
}
catch (Exception ee)
{
m_log.LogError( ee.Message, new StackFrame(true ));
}
finally
{
m_connection.Cl ose();
}
</code>
I honestly can't tell what is doing this. Googling hasn't shed much
light.
Anyone know common causes for this exception?
Thanks for any help,
Steve


Dec 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5045
by: BJ | last post by:
The application I have been developing is great except one flaw. When Windows NT shuts down, it doesn't send the Event to my application (if it did, it would close all of the open forms and kill an activity flag I create on launch) and an error comes up that says "Cannot Quit". I have no idea where this error is coming from as I did put it in there. I am unsure if this is because of the hidden form which has a bunch of timers on it (I...
4
2495
by: Jian H. Li | last post by:
Hello, What's the essential differences between the two ways of "class::member" & "object.member"(or object_pointer->member)? class C{ public: void f() {} int i; };
11
2469
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to the spec (10.1.6) the activation-object already contains the the parameters-object when the variables are instantiated (10.1.3). The question is now: does a parameter "parameters" overwrite the "parameters"-object or not? All three implementations...
0
1670
by: jwalton | last post by:
I have a new Web Service (written in C#) that is giving me major problems. The Consumer application is written in VB.NET. When executed totally on localhost it works 100%. When standalone Web Service is executed on production server using Form-based ASP.NET test mode, it works 100%. When Web Service is executed on production server with Consumer on localhost it works 100%. However when Web Service and Consumer are both executed totally on...
1
6890
by: JohnZing | last post by:
i tried to install asp.net forums all went ok, but after login i always get "Object moved to here." in firefox or "The page cannot be displayed" in IE when i hit refresh, the page loads fine. the problem occurs only when i try to run the application hosted in my hosting provider, not in my local IIS server. any ideas?
5
2680
by: rod.weir | last post by:
Hello, I have the following code to iterate through each view in a SQL Server and call the "sp_refreshview" command against it. It works great until it finds a view that is damaged, or otherwise cannot be refreshed. Then the whole routine stops working. Can someone please help me re-write this code so that any views that fail the "sp_refreshview" command get skipped. I'm sure it's just a matter of putting some basic error trapping...
1
4677
by: juergen | last post by:
Hi, there are many postings on this subject, I have read them put don't have an answer. I get these warnings: Cannot send session cookie - headers already sent in, but my php-scripts are okay. As you can see in the code and response below, I really don't output anything. I am at EVANZO.
16
47692
by: Steve Chapel | last post by:
When I load the page <https://bugzilla.mozilla.org/attachment.cgi?id=237739with Internet Explorer 7 RC 1, I get the error "Object Expected" at line 174. When I click on the button, I also get the same error on line 186. This same HTML and JavaScript works perfectly in Firefox and Opera. How can I make the code work in IE?
2
9014
by: snester | last post by:
Hi, I am using visual studio 2005 and recently created a new web service project. I seem to have edited the global config file (inadvertently) somewhere along the line. All new projects I have created since the above web service project have generated two errors while debugging. The first error, I believe I have fixed but I cannot fix the second error. I mention the first error below incase it is the cause of the second error.. 1)...
0
8766
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8684
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8975
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5930
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4438
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4699
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3134
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.