高分~100分~LInq 的Data更新的存储过程不显示, 希望大家帮帮忙!谢谢!
写了一个存储过程 http://topic.csdn.net/u/20120724/11/4e29c12f-f624-4c82-8c08-e10596067d46.html
当我把它更新到 项目的实体层 Data里, 我在运行系统后, 下拉列表就是获取不到,普通的表和视图存储过程都可以获取的到!就是这个不行!
下拉列表--(里面就是显示项目里的表和存储过程!查询出来显示在列表中的那种)
原因推测:
1、是不是没有返回值的问题!
2、此存储过程使用了 临时的问题!
希望大家帮帮忙!谢谢!
- C# code
[Function(Name="dbo.P_SaleOrderRtnMonth")] public ISingleResult<P_SaleOrderRtnMonth_个结果> P_SaleOrderRtnMonth([Parameter(Name="BeginDate", DbType="DateTime")] System.Nullable<System.DateTime> beginDate, [Parameter(Name="EndDate", DbType="DateTime")] System.Nullable<System.DateTime> endDate) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), beginDate, endDate); return ((ISingleResult<P_SaleOrderRtnMonth_个结果>)(result.ReturnValue)); } [Function(Name="dbo.P_CustomerDate_City")] public ISingleResult<P_CustomerDate_City_个结果> P_CustomerDate_City([Parameter(Name="BeginDate", DbType="DateTime")] System.Nullable<System.DateTime> beginDate, [Parameter(Name="EndDate", DbType="DateTime")] System.Nullable<System.DateTime> endDate) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), beginDate, endDate); return ((ISingleResult<P_CustomerDate_City_个结果>)(result.ReturnValue)); }//上面2个是正常的!//就是下面这个dbo.P_Wms_StockMoneyState显示不出来 [Function(Name = "dbo.P_Wms_StockMoneyState")] public int P_Wms_StockMoneyState([Parameter(DbType = "VarChar(30)")] string datetime) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), datetime); return ((int)(result.ReturnValue)); }[解决办法]
重新映射 dbml或edmx文件后重新生成项目试试看
[解决办法]
朋友你可以用记事本打开你资源管理器下面的那个emdx文件,然后收索你那个加不进去的存储过程的名称,然后看看报什么错误,是不是没有主键,如果是就是你select的时候没有把任何id查出来,你随便加进去个id就行了,如果不是,你根据提示在看看是什么问题!!!!!
[解决办法]
这个慢慢调试
[解决办法]
1楼的意思是你在IDE里重新将存储过程拖进来重新映射一下
然后重新生成项目试下