473,508 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error Message: Unable to cast object of type

Hi,

I'm trying to create a reusable component with C#.
So, I created a user control that uses Microsoft SQLDMO
Object Library (SQLDMO).
And I could add that UserControl on Toolbox.
However, whenever I'm trying to add this user control on
the client program's form I'm getting the following error
message.
----------------------
An exception occurred while trying to create an instance
of RNCLoadCtl.UserControl.
The exception was "Unable to cast object of type
SQLDMO.ApplicationClass to type
SQLDMO.ApplicationClass.".
----------------------
Does anyone know about this error message?
Is there any walkaround of this?
Any comment would be helpful

I'm using the Visual Studio .NET 2002 Soultion
Architecture version on Windows XP professional machine.

Thank you.


Nov 15 '05 #1
1 4222
hrhoe,

On the client machine using your user control, try and add the interop
assembly as a reference before you add your control to the form. I think
that it is having a problem here.

Also, it could be that the type wrapper generated by the client machine
is different from yours (if you don't distribute the type wrapper, this
could very well be it). What you would have to do in this case is have the
project reference your wrapper, since it will have a different signature
than the one that their version of VS.NET would create.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"hrhoe" <hr***@hotmail.com> wrote in message
news:0e****************************@phx.gbl...
Hi,

I'm trying to create a reusable component with C#.
So, I created a user control that uses Microsoft SQLDMO
Object Library (SQLDMO).
And I could add that UserControl on Toolbox.
However, whenever I'm trying to add this user control on
the client program's form I'm getting the following error
message.
----------------------
An exception occurred while trying to create an instance
of RNCLoadCtl.UserControl.
The exception was "Unable to cast object of type
SQLDMO.ApplicationClass to type
SQLDMO.ApplicationClass.".
----------------------
Does anyone know about this error message?
Is there any walkaround of this?
Any comment would be helpful

I'm using the Visual Studio .NET 2002 Soultion
Architecture version on Windows XP professional machine.

Thank you.

Nov 15 '05 #2

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

Similar topics

0
7359
by: Pankaj Jain | last post by:
Hi All, I have a class A which is derived from ServicesComponent to participate in automatic transaction with falg Transaction.Required. Class A is exposed to client through remoting on Http...
0
2889
by: Wes Shaddix | last post by:
I have a vendor web service that I have created a web application to interact with. The service works fine in VS 2003 but fails in VS 2005. I have implemented a proxy between the web client and...
0
23446
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
0
6212
by: ritesh.singhal | last post by:
Hi, I am trying to do server side office automation. I have a word template which I am trying to populate with data from SQL server but when I try to generate the Word document I get following...
4
2447
by: JackBlack | last post by:
Hi, all! Need a little help tracking down a runtime error problem. I'm getting this error: "Unable to cast object of type 'myStruct' to type 'myStruct'... but the two types are identical! I...
6
2071
by: Bmack500 | last post by:
Hello, and Thanks in advance! Using: Vstudio 2005, XP, .NET 2.0 I'm getting the following error when running my code below. I'm passing an object array which contains other variables. It happens...
1
2931
by: epatrick | last post by:
I have a series of custom controls developed under ASP.NET 1.1, and I've successfully migrated to ASP.NET 2.0. I have also developed a custom class dervied from System.Web.UI.Page, called...
1
11317
by: sana krishna | last post by:
Hai, Pls anyone help me........................... I am using ASP.NET(C#). I want to display the data in a gridview and make the gridview to become editable and insert and delete. But i can't...
2
1798
by: Mittalswati | last post by:
Hi All I am getting the below mentioned error while accessing the page which uses VB.Net Dll ,Please look in to the matter and suggest some solution Unable to cast COM object of type...
0
7223
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,...
0
7115
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...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7489
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...
0
5624
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,...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.