Print Page | Close Window

To get the New

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=888
Printed Date: 28-Apr-2025 at 7:59am


Topic: To get the New
Posted By: viralvasaiwala
Subject: To get the New
Date Posted: 14-Jul-2008 at 11:53pm
 
Hello,
 
we are trying to set connection string dynamically with the datalayer of the appication. But we are facing problem with IDataSourceKeyResolver.
 
Here is  the codesnippet of Metadata is given below, where we are not able to implement this method in our class. We are getting an error of IdeaBlade.Util.IDataSourceKey
====================================================================================
using System;

namespace IdeaBlade.Persistence
{
        public interface IDataSourceKeyResolver
        {
                IdeaBlade.Util.IDataSourceKey GetKey(string pKeyName, string pKeyExtension);
        }
====================================================================================
 
When we implement it we are getting an error given below:
====================================================================================
The type or namespace name 'IDataSourceKey' does not exist in the namespace 'IdeaBlade.Util' (are you missing an assembly reference?) ........\AppHelper\HEDataSourceKey.cs
 
* Reason is IDataSourceKey belongs to "IDEABLADE.UTIL.v4" not in "IDEABLADE.UTIL"
====================================================================================
 
 
 
 
If we change the implementation in the below manner:
Code Snippet
====================================================================================
        IdeaBlade.Util.v4.IDataSourceKey GetKey(string pKeyName, string pKeyExtension)
        {
             String ConnectionStringNew = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=xxxx;Data 
            Source=xxxx\\serverhere";
            IdeaBlade.Util.v4.IDataSourceKey objKey = new IdeaBlade.Rdb.v4.RdbKey(pKeyName, ConnectionStringNew);
            return objKey;
        }
====================================================================================
 
After the above changes now we are getting the error :
====================================================================================
Error 1 'AppHelper.HEDataSourceKey' does not implement interface member 'IdeaBlade.Persistence.IDataSourceKeyResolver.GetKey(string, string)'. 'AppHelper.HEDataSourceKey.GetKey(string, string)' cannot implement an interface member because it is not public. \AppHelper\HEDataSourceKey.cs 12 16 AppHelper
====================================================================================
 
 
Please reply for this issue as early as possible.
 



Replies:
Posted By: kimj
Date Posted: 15-Jul-2008 at 10:11am
Are you writing a DevForce EF application or a "hybrid" DEF-WinForms application?  In either case, you don't need the IdeaBlade.Persistence.* assemblies.
 
In DEF, the IDataSourceKeyResolver is part of the IdeaBlade.EntityModel.v4 namespace.    Also, although the RdbKey was retained for legacy purposes in DEF, it is not used internally by the framework.  You should be returning an EdmKey from the IDataSourceKeyResolver implementation.



Print Page | Close Window