PC Review


Reply
Thread Tools Rate Thread

DbConnection

 
 
=?Utf-8?B?Um95?=
Guest
Posts: n/a
 
      20th Jul 2006
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.
 
Reply With Quote
 
 
 
 
Tom Winter
Guest
Posts: n/a
 
      26th Jul 2006
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.



 
Reply With Quote
 
Tom Winter
Guest
Posts: n/a
 
      26th Jul 2006
This link might help. I hope it comes through OK:

http://groups.google.com/group/micro...730d58cdb34ea6

-Tom


"Tom Winter" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DbConnection and Finalizer Trecius Microsoft C# .NET 3 18th Aug 2008 11:08 PM
Which Namespace for DBConnection? RSH Microsoft VB .NET 2 11th Sep 2007 11:40 AM
DbConnection =?Utf-8?B?VHJlY2l1cw==?= Microsoft C# .NET 15 16th Aug 2007 05:56 PM
stop dbconnection in InitializeComponent() jarb Microsoft Dot NET Framework Forms 1 31st Oct 2006 12:31 AM
ADO.Net DBConnection Visualizer codemonkey Microsoft ADO .NET 0 26th Jul 2006 02:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:02 AM.