473,804 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A casting error occured

11 New Member
I have created the Data access Logic component and when I execute the DALC an error occured like this "Cannot implicitly convert type 'x' to 'y'. An explicit conversion exists (are you missing a cast?) "

This error occured while I was trying to insert the records in the DB through the DAL component.
plz help me if anyone know the solution for this. Reply me as soon as possible, its very urgent....

Thanks in advance.

Regards,
kani.z
May 23 '08 #1
3 1203
Plater
7,872 Recognized Expert Expert
These type of questions make my headhurt.
They exception message tells you everything you need to know.
Somewhere you are trying to convert one object to another.
The fact that it tells you an explicit conversion exists, means you can type-cast it.
Go to the offending objects and type cast one to match the object you are assigning it to.
May 23 '08 #2
kanimozhiz
11 New Member
These type of questions make my headhurt.
They exception message tells you everything you need to know.
Somewhere you are trying to convert one object to another.
The fact that it tells you an explicit conversion exists, means you can type-cast it.
Go to the offending objects and type cast one to match the object you are assigning it to.

Thanks for ur reply.

I am new to C# .net I don't know how to type cast? Can u tell me how to type cast with the example coding, then it will be very useful for me to understand better.

Thanks & regards,
kani.z
May 23 '08 #3
Frinavale
9,735 Recognized Expert Moderator Expert
Thanks for ur reply.

I am new to C# .net I don't know how to type cast? Can u tell me how to type cast with the example coding, then it will be very useful for me to understand better.

Thanks & regards,
kani.z
You really should invest in a good C# book.
This is basic stuff that should be covered in the first chapters of any programming book.

Check out the MSDN library if you cannot afford a book. There are lots of tutorials and every topic is covered.

For instance Casting using C# is covered here.

Cheers!

-Frinny
May 23 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2933
by: josh dismukes | last post by:
/// here is the code i'm getting a parse error on the last line of the code which /// is </html> any help will be much appreciated. <?php session_start ();
1
1904
by: Remo | last post by:
Hi I want to install the VS .Net 2003 Prof on my XP prof First i tryed the installation, but error occured during required comps. Reading docu, they say install required comps by hand, doing so, install IE6SP1 ,...., and at DotnetFx.EXE it works great, copy files, register all, and at the end, an error occured (all will be rolled back): Microsoft .NET Framework 1.1 Setup Error 1935. An Error occured during the installation of assembly...
231
23253
by: Brian Blais | last post by:
Hello, I saw on a couple of recent posts people saying that casting the return value of malloc is bad, like: d=(double *) malloc(50*sizeof(double)); why is this bad? I had always thought (perhaps mistakenly) that the purpose of a void pointer was to cast into a legitimate date type. Is this wrong? Why, and what is considered to be correct form?
7
3683
by: yufufi | last post by:
lets say we have a 'shape' class which doesn't implement IComparable interface.. compiler doesn't give you error for the lines below.. shape b= new shape(); IComparable h; h=(IComparable)b; but it complains for the following lines
44
2245
by: Agoston Bejo | last post by:
What happens exactly when I do the following: struct A { int i; string j; A() {} }; void f(A& a) { cout << a.i << endl;
2
1742
by: sean | last post by:
Hi there, I am trying to call a C# web service from an aspx page, I have the asmx file, a user control file ascx and the aspx file. I have verified that the web service is returning correct values from the service, however when I try to load the aspx page it falls over in a cruumbling heap! Could someone tell me what I am doing wrong as I know that I am close to getting this thing working. Thanks in advance for your answer
4
1336
by: Slasher186 | last post by:
Hi all, First of all, I'm sorry if I posted at the wrong section here, but I can't seem to find the VB 6.0 newsgroup ? I'm developing my apps with VB 6.0 sp5 installed on win xp. I have create an exe file that runs fine on both winxp and win2k. However, when I try to execute that file on win 98 machine, there are errors. This error may vary between "EOF or BOF expected.." or "Error 13, Type mismatch". I've tried over and over again to do...
7
13717
by: S. Lorétan | last post by:
Hi guys, Sorry for this stupid question, but I don't know why it isn't working. Here is my (example) code: namespace Test { class A { public string Label1; }
32
2398
by: alex.j.k2 | last post by:
Hello all, I have "PRECISION" defined in the preprocessor code and it could be int, float or double, but I do not know in the code what it is. Now if I want to assign zero to a "PRECISION" variable, which of the following lines are correct:
0
9706
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
10332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9152
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
6853
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
5522
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.