Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Object type cannot be converted to target type.

Posted on 2004-10-12
5
Medium Priority
?
1,108 Views
Last Modified: 2007-12-19
Hello

I receive 4 of the same errors in the task pane (with a form icon to the left of the below text)

Object type cannot be converted to target type.

When I double click this, the code view opens and the cursor points at the very top of the file.

Note the project compiles with 0 errors and warnings, but I would like to know how to get rid of these errors in the task pane. Where to start debugging such a problem?
0
Comment
Question by:auk_ie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
tinchos earned 450 total points
ID: 12292044
The problem you're having is that you're trying to cast an object to a type that cannot be casted to.

What you should do is debug your program and when you get to the part where it throws that exception
watch what is the type of the object you're casting and check if it is the same as the type you want to convert to.

Hope this helps

Tincho
0
 

Author Comment

by:auk_ie
ID: 12292792
Do you mean run the program in debug mode. I have tried that but it doesn't throw any exceptions.

If thats not what you mean, can you ellaborate.

Also I don't understand why when I click on any of the four errors, the cursor points me to the top of the file

i.e.
using System;

and not the error in question. What dous that form icon beside the error mean?
0
 
LVL 9

Expert Comment

by:tinchos
ID: 12293005
Sorry, but then, when are you receiving the errors?
when you compile it?

Tincho
0
 
LVL 10

Assisted Solution

by:Hans Langer
Hans Langer earned 300 total points
ID: 12293330
Do you use Control Version ?
Maybe the File is Read-Only
0
 

Author Comment

by:auk_ie
ID: 12293763
Yes its very strange

I think this error had something to do with crystal reports 9 that I installed after installing VS .nwt 2003 which came with v 10. But any way it's gone now after me verifying DB in the designer.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question