I'm doing the same basic thing and getting the same error. I believe it's
because DbConnection (and DbCommand) are descended from Component. I just
right click on the class and select View Code. Everything else seems to work
and it compiles OK.
--
Tom Winter
(E-Mail Removed)
"Roy" <(E-Mail Removed)> wrote in message
news:8E27CA63-0824-4D52-9EA2-(E-Mail Removed)...
>I created my own DbConnection class
>
> using System;
> using System.Data;
> using System.Data.Common;
> using System.Xml;
>
> namespace MyNS
> {
> public sealed class MyConnection : DbConnection, ICloneable
> {
> // code implement DbConnection and ICloneable
> ...
> }
> }
>
> But Visual Studio 2005 keeps complaining when I try to open this file as
> follows:
>
> One or more errors encountered while loading the designer. The errors are
> listed below. Some errors can be fixed by rebuilding your project, while
> others may require code changes.
>
> The designer must create an instance of type
> 'System.Data.Common.DbConnection' but it cannot because the type is
> declared
> as abstract.
> Hide
>
> at
> System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager
> manager, String exceptionText, String helpLink)
> at
> System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager
> manager, CodeTypeDeclaration declaration)
> at
> System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
> manager)
> at
> Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
> serializationManager)
> at
> System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
> host)
>
>
> I also see the icon for the file changes and if I remove the DbConnection
> that MyConnection is inherited from. It is working fine.
>
> Any ideas about this.