本文介绍了ADO .NET函数导入.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经实现了Windows客户端程序,以使用ado.net实体框架访问数据库.在数据库中,我还具有视图"和存储过程".我在ado.net中使用函数导入来调用存储过程.通过视图"搜索存储过程.

我现在遇到的麻烦就是这样.说,我通过连接两个表"Persons"和"PersonalIdentities"创建了一个视图,每个人不能有一个或多个身份.因此,当我离开外部联接表"Persons"时
如果一个人有很多身份数据库视图,则使用"PersonalIdentities"显示该人的多个记录.

前一个人的名字是Isuru,具有两个标识542698V,458216X

数据库视图是这样的

|伊苏鲁| | 542698V |
|伊苏鲁| | 458216X |

我创建的存储过程可以搜索人名,并从视图中给出结果集.如果我执行存储过程,它将按预期方式工作.但是,当我在实体框架工作中使用函数导入调用存储过程时,会发生这种情况.

|伊苏鲁| | 542698V |
|伊苏鲁| | 542698V |

它给出两个记录,但记录相同.我花了几个小时,无法提出解决方案.

我的公开时间太长,无法解释这种更好的方法.感谢和问候.

Hi Everyone,

I have implemented a windows client program to access a database using ado.net entity framework. In database I also have "views" and " stored procedures" . I use function imports in ado.net to call stored procedures. Stored procedure search through the "view".

Trouble I''m having now is like this. Say ,I created a view by joining two tables "Persons" and "PersonalIdentities" each person can have no or more than one identities. So when i left outer join table "Persons"
with "PersonalIdentities" if one person have many identites database view show multiple records for that person Person.

Ex person name is Isuru and have two identites 542698V, 458216X

Database view is like this

|Isuru| |542698V|
|Isuru| |458216X|

Stored procedure I created can search for person name and give results set from view. If I execute stored procudre, It works the expected way. But when I call stored procedure using function import in entity frame work, this happens.

|Isuru| |542698V|
|Isuru| |542698V|

It gives two records but same record. I dig hours and couldn''t came up with a solution.

My discripion is too long, I couldn''t explain this better way. Thanks and regards.

推荐答案


这篇关于ADO .NET函数导入.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 22:56