问题描述
我在下面写了这样的代码
公共类WcfDataService1:DataService< durgaentities>
{
#region此方法只调用一次以初始化服务范围的策略。
public static void InitializeService(DataServiceConfiguration config)
{
try
{
config.SetEntitySetAccessRule(*,EntitySetRights.AllRead); //读取实体数据表
config.SetEntitySetPageSize(* ,25);
//config.SetServiceOperationAccessRule(\"GetEmployeeList,
// ServiceOperationRights.All); //来电getemployeelist方法
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
//config.DataServiceBehavior.MaxProtocolVersion = DataServiceProt ocolVersion.V3;
}
catch(exception ex)
{
throw ex;
}
终于
{
}
}
# endregion
在我作为excel电源查询使用此服务后我输入了我的服务网址然后我得到了我的桌子但不包含任何数据
i得到Excel2013这样的错误我们无法从DataModel获取数据和errror消息你得到这样的远程服务器返回错误请帮助我,我尝试了很多方式所以很多天但我仍然没有得到解决方案
i wrote below code like this
public class WcfDataService1 : DataService<durgaentities>
{
#region This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
{
try
{
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);//to read entity data table
config.SetEntitySetPageSize("*", 25);
//config.SetServiceOperationAccessRule("GetEmployeeList",
// ServiceOperationRights.All);//to call getemployeelist method
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
//config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V3;
}
catch (Exception ex)
{
throw ex;
}
finally
{
}
}
#endregion
after i consumed this service as an excel power query and i entered my service url then i am getting my table but not contain any data
i was getting Excel2013 Error like this "we couldn't get data from the DataModel and errror mesage u got like this "The remote server returned an error" please help me i tried so many ways so many days but still i am not getting solution
推荐答案
这篇关于odata服务消费卓越的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!