Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sample ".NET Framework Data Provider"

50 views
Skip to first unread message

Mike McCarthy

unread,
Jun 10, 2003, 12:02:10 PM6/10/03
to
I am using the example from the Sample ".NET Framework Data Provider ".

The problem I am having is with TemplateDataAdapter.cs . A "designer" icon
shows up and when I click on it in the solution explorer and then I get an
error.
//TemplateDataAdapter.cs
using System;

using System.Data;

using System.Data.Common;

namespace DotNetDataProviderTemplate

{


public class TemplateDataAdapter : DbDataAdapter, IDbDataAdapter

{}

}


The error is...
An error occurred while loading the document. Fix the error, and then try
and load the document again. The error message follows:
The designer must create an instance of type
'System.Data.Common.DbDataAdapter' but it cannot because the type is
declared as abstract.

Two questions.
1) Why does the designer icon show up beside the TemplateDataAdapter.cs
file.
2) How do I fix the error?

Felix Wu [MSFT]

unread,
Jun 11, 2003, 1:33:52 AM6/11/03
to
Hi Mike,

> 1) Why does the designer icon show up beside the TemplateDataAdapter.cs

file?
IDE will show such a designer icon beside the file if the class derives
from Component directly or indirectly. In this case, the DataAdapter class,
the base class of DbDataAdapter, derives from Component class, so that the
IDE display a designer icon beside the file. Since the DbDataAdapter is an
abstract class, the VS.NET designer cannot create an instance of it.

> 2) How do I fix the error?

You do not need to do anything actually. To use this sample, you just need
to compile the source code to an assembly and then reference the assembly
in your application. You can find more information on this link:

Sample .NET Data Provider
http://msdn.microsoft.com/library/en-us/cpguide/html/cpcontemplatefiles.asp

Important Note: There are some code errors in the sample, please read the
article to fix them:

DOC: Corrections to Visual C# .NET Samples in "Sample .NET Data
http://support.microsoft.com/default.aspx?scid=KB;EN-US;317952

Hope this helps,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: "Mike McCarthy" <mmcc...@aethersystems.com>
| Subject: Sample ".NET Framework Data Provider"
| Date: Tue, 10 Jun 2003 12:02:10 -0400
| Lines: 38
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <eUJzom2L...@TK2MSFTNGP10.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 146.115.130.252
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:161607
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Mike McCarthy

unread,
Jun 11, 2003, 4:33:15 PM6/11/03
to
Thanks. Now I have to figure out how to get rid of all of the SampleDb
stuff.
Do you have an implimitation example that doesn't use the SampleDb stuff.
I am new at this and I can see that the SampleDb stuff is being used.
I'd like to try a real connection with a real database.
Can anyone help me out with this sample?

"Felix Wu [MSFT]" <fel...@online.microsoft.com> wrote in message
news:vZUPPs9L...@cpmsftngxa06.phx.gbl...

Felix Wu [MSFT]

unread,
Jun 16, 2003, 7:24:44 AM6/16/03
to
Hi Mike,

I don't have a version without using the SampleDb stuff. You can modify the
code sample to replace the SampleDb with a real database. The sample is
well commented, so it can help you replace the SampleDb. Anyway, I have to
say that it still requires a lot of work.

You can refer to the MSDN or other ADO.NET resouces to get more information
about how to implement a data adapter.

If you absolutely need a response from Microsoft, you might also want to
check out the various support options available at
http://support.microsoft.com

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: "Mike McCarthy" <mmcc...@aethersystems.com>

>References: <eUJzom2L...@TK2MSFTNGP10.phx.gbl>
<vZUPPs9L...@cpmsftngxa06.phx.gbl>
>Subject: Re: Sample ".NET Framework Data Provider"
>Date: Wed, 11 Jun 2003 16:33:15 -0400
>Lines: 106


>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165

>Message-ID: <ugZsxiFM...@TK2MSFTNGP11.phx.gbl>
>Newsgroups: microsoft.public.dotnet.languages.csharp
>NNTP-Posting-Host: 146.115.130.252
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:161984
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

0 new messages