Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Still Can't Figure This Out
Message
From
11/10/2004 12:36:31
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00950462
Message ID:
00950470
Views:
11
Kevin,

If you look at the docs for IDBConnection, you'll see that the ChangeDatabase() method requires a parameter and you have no paramter in your method. I don't know if it's a typo on your part, or in the book, but fix that (and also implement the property that you're erroring on, ConnectionString) and you should be good to go.

~~Bonnie



>I have Kevin McNeish' book '.Net for Visual FoxPro Developers' and I typed in the
>code on page 141 (pasted below) into a VB class.
>
>When I compile, I get the following errors:
>'ChangeDatabase' cannot implement 'ChangeDatabase' because there is no matching sub on interface 'IDbConnection'.
>'ConnectionString' cannot implement 'ConnectionString'...
>'ConnectionTimeOut' cannot implement 'ConnectionTimeOut'...
>'State' cannot implement 'State'...
>
>and 5 more like this:
>
>'VfpConnection.VfpConnection' must implement 'Overridable Property ConnectionString() As String' for interface 'System.Data.IDbConnection'. Implementing property must have matching 'ReadOnly'/'WriteOnly' specifiers.
>
>
>What am I doing wrong?
>
>
>
>
>Public Class VfpConnection
>
> Implements System.Data.IDbConnection
>
> ' Properties
> Public Function ConnectionString() As String() _
> Implements IDbConnection.ConnectionString
> ' Place code here
> Return Nothing
> End Function
>
> Public Function ConnectionTimeOut() As String() _
> Implements IDbConnection.ConnectionTimeOut
> ' Place code here
> Return Nothing
> End Function
>
> Public Function Database() As String() _
> Implements IDbConnection.Database
> ' Place code here
> Return Nothing
> End Function
>
> Public Function State() As String() _
> Implements IDbConnection.State
> ' Place code here
> Return Nothing
> End Function
>
> Public Overloads Function BeginTransaction() As IDbTransaction _
> Implements IDbConnection.BeginTransaction
> ' Place code here
> Return Nothing
> End Function
>
> Public Overloads Function BeginTransaction(ByVal level As System.Data.IsolationLevel) _
> As IDbTransaction _
> Implements IDbConnection.BeginTransaction
> ' Place code here
> Return Nothing
> End Function
>
> Public Sub ChangeDatabase() _
> Implements IDbConnection.ChangeDatabase
> ' Place code here
> End Sub
>
> Public Sub Close() _
> Implements IDbConnection.Close
> End Sub
>
> Public Function CreateCommand() As IDbCommand _
> Implements IDbConnection.CreateCommand
> ' Place code here
> Return Nothing
> End Function
>
> Public Sub Open() _
> Implements IDbConnection.Open
> ' Place code here
> End Sub
>
>End Class 'VfpConnection
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform