Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

cannot derive from sealed type 'float'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrus - 20 Jul 2007 14:42 GMT
I try to compile myGeneration source code using Visual C# Express 2005
Express.

File starts with

using System;
using System.Xml;
using System.Data;
using System.Data.OleDb;

namespace MyMeta
{
public class Table : Single, ITable, INameValueItem
{
 public Table()
 {

 }

compiling causes error  in "public class Table line":

MyMeta.Table': cannot derive from sealed type 'float'

This is working code so i expect that code is correct and can be compiled t
can be compiled in some way without changing it.

Why I got compile error ?
How to fix ?

Andrus.
Hans Kesting - 20 Jul 2007 15:41 GMT
> I try to compile myGeneration source code using Visual C# Express 2005
> Express.
[quoted text clipped - 23 lines]
> How to fix ?
> Andrus.

Do you have your own 'Single' type? The compiler treats the 'Single' you
mention as System.Single, for which 'float' is an alias.
If it is your own type, use the full namespace.

Hans Kesting
Nicholas Paldino [.NET/C# MVP] - 20 Jul 2007 15:52 GMT
Andrus,

   It is not working code.  Single (float) is a value type, and they are
sealed, you can not derive from them.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

>I try to compile myGeneration source code using Visual C# Express 2005
> Express.
[quoted text clipped - 26 lines]
>
> Andrus.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.