(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.CommandText = GetAccessSprocString(m_spDeleteProtocol);
m_command.Parameters.Clear();
OleDbParameter param = new OleDbParameter("_protocolID",
protocol.ProtocolID);
m_command.Parameters.Add(param);
// open the connection and execute the update
m_connection.Open();
m_command.ExecuteNonQuery(); // 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.Close();
}
</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 2 8106
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.com
"Steve" <ss*@sss.com> wrote in message
news:Oi**************@TK2MSFTNGP12.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.CommandText = GetAccessSprocString(m_spDeleteProtocol); m_command.Parameters.Clear(); OleDbParameter param = new OleDbParameter("_protocolID", protocol.ProtocolID); m_command.Parameters.Add(param);
// open the connection and execute the update m_connection.Open(); m_command.ExecuteNonQuery(); // 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.Close(); } </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
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.com> wrote in
message news:OE**************@TK2MSFTNGP10.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.com
"Steve" <ss*@sss.com> wrote in message news:Oi**************@TK2MSFTNGP12.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.CommandText = GetAccessSprocString(m_spDeleteProtocol); m_command.Parameters.Clear(); OleDbParameter param = new OleDbParameter("_protocolID", protocol.ProtocolID); m_command.Parameters.Add(param);
// open the connection and execute the update m_connection.Open(); m_command.ExecuteNonQuery(); // 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.Close(); } </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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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;
};
|
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...
|
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...
|
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.
...
|
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...
|
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.
...
|
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...
|
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...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |