我有一个C#程序,它运行一个存储过程。如果我从Microsoft SQL Server Management Studio运行存储过程,它可以正常工作。它执行需要大约30秒。然而,如果我尝试从C#程序运行相同的存储过程,它会超时,尽管我已经在连接字符串中设置了超时时间为10分钟。
using (connection1 = new SqlConnection("user id=user_id_goes_here;password=password_goes_here;initial catalog=database_name_goes_here;data source=server_name_goes_here;connection timeout=600))
尽管我将其设置为允许10分钟(用于测试目的),但大约30秒后它似乎超时了。