0

Please, could you give me some tips for my problem with table valued function in SQL?

I am designing Windows Forms app in C#, Visual Studio and I am using Entity Framework to join SQL database.

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). It shows exception that time expired (after maybe 30 seconds).

The strange thing is, that usually after PC restart table valued function starts to work OK for a while.

Please, do you have any suggests what to do with it?

I am using Microsoft sql server.

Thank you very much.

2

1 Answer 1

0

It seems like the problem is not on the server-side. Check out that: Set database timeout in Entity Framework

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, I will check it! Problem is, that if function works correctly, result is in a second. But from time to time function just frozes for a minute and then it throws thi error...
It may also depend on the server load. Is it a local server or an online server. The exception is not server dependent but the running time depends on the server load.
It is local, so it should be OK. It works in sql query fine, problem is just from time to time and in entity framework.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.