简体   繁体   English

SQL 表值 function 和使用 C# 的实体框架

[英]SQL table valued function and Entity Framework using C#

Please, could you give me some tips for my problem with table valued function in SQL?拜托,你能给我一些关于 SQL 中表值 function 的问题的提示吗?

I am designing Windows Forms app in C#, Visual Studio and I am using Entity Framework to join SQL database.我正在 C#、Visual Studio 中设计 Windows Forms 应用程序,我正在使用实体框架加入 Z97788240A0101CB30BA 数据库。

I've already created number of table valued functions and most of them work fine, but a few of them don't.我已经创建了许多表值函数,它们中的大多数都可以正常工作,但其中一些不能。

They usually works OK, but from time to time it freezes when program starts to read data from SQL (using foreach).它们通常可以正常工作,但是当程序开始从 SQL(使用 foreach)读取数据时,它有时会冻结。 It shows exception that time expired (after maybe 30 seconds).它显示时间已过的异常(可能在 30 秒后)。

The strange thing is, that usually after PC restart table valued function starts to work OK for a while.奇怪的是,通常在 PC 重新启动表值 function 后开始正常工作一段时间。

Please, do you have any suggests what to do with it?请问,你有什么建议吗?

I am using Microsoft sql server.我正在使用 Microsoft sql 服务器。

Thank you very much.非常感谢。

It seems like the problem is not on the server-side.似乎问题不在服务器端。 Check out that: Set database timeout in Entity Framework看看: 在实体框架中设置数据库超时

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM