Print Page | Close Window

Custom datasourcekey

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1111
Printed Date: 28-Mar-2024 at 8:39am


Topic: Custom datasourcekey
Posted By: lars-erik
Subject: Custom datasourcekey
Date Posted: 04-Mar-2009 at 1:36am
I have just upgraded to 3.6.5.4. Now my custom datasourcekeyresolver in Apphelper no longer compiles.
I get errors:

Error    39    Class 'MyDataSourceKeyResolver' must implement 'Function GetKey(pKeyName As String, pKeyExtension As String) As Util.IDataSourceKey' for interface 'IdeaBlade.Persistence.IDataSourceKeyResolver'.    C:\Documents and Settings\Administrator.TIMPEXAS\My Documents\Visual Studio Projects\larserik\skanning_trunk\src\ScanFrbClient_lok\AppHelper\MyDataSourceKeyResolver.vb    6    51    AppHelper

Error    40    'GetKey' cannot implement 'GetKey' because there is no matching function on interface 'IdeaBlade.Persistence.IDataSourceKeyResolver'.    C:\Documents and Settings\Administrator.TIMPEXAS\My Documents\Visual Studio Projects\larserik\skanning_trunk\src\ScanFrbClient_lok\AppHelper\MyDataSourceKeyResolver.vb    9    129    AppHelper



This is my code:
Imports IdeaBlade.Persistence
Imports IdeaBlade.Util
Imports IdeaBlade.Rdb

<Serializable()> _
Public Class MyDataSourceKeyResolver : Implements IDataSourceKeyResolver


    Public Function GetKey(ByVal pKeyName As String, ByVal pKeyExtension As String) As IdeaBlade.Util.IDataSourceKey Implements IdeaBlade.Persistence.IDataSourceKeyResolver.GetKey
        If (pKeyExtension.ToLower() <> "default") Then

            Dim connectionString As String = pKeyExtension
            Return New IdeaBlade.Rdb.RdbKey(pKeyName, connectionString)
        Else
            Return Nothing ' Didn't build key; DefaultDataSourceKeyResolver takes over
        End If

    End Function

End Class


 



Replies:
Posted By: kimj
Date Posted: 04-Mar-2009 at 2:39pm
The IDataSourceKeyResolver and IDataSourceKey interfaces haven't changed in several years, so I'm not sure what's going on here.  Double check that references to the AppHelper project are correct. 
 
Also, since in another thread you indicate you've got a problem with a license violation, it's possible that your install was somehow corrupt, so you may want to uninstall and re-install to see if that fixes things.



Print Page | Close Window