【问题标题】:Step into stored procedure SQL Azure from Visual Studio 2017从 Visual Studio 2017 进入存储过程 SQL Azure
【发布时间】:2018-11-30 06:02:34
【问题描述】:

Visual Studio 2017 社区版使用以下代码跳过我的 ExecuteScalarExecuteNonQuery

using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["DataContext"].ConnectionString))
{
    con.Open();
    var sc = new SqlCommand("InsertOrUpdate", con);
    sc.CommandType = System.Data.CommandType.StoredProcedure;
    sc.Parameters.AddWithValue("code", "some string code");
    var o = sc.ExecuteScalar(); // is null. cannot step into
    int newPrimaryKey = Convert.ToInt32(o); // stays zero
}

我的 app.config 数据上下文中有一个 azure sql 服务器,还有一个 localdb Server=(localdb)\MSSQLLocalDB;Integrated Security=true 两者都不会进入(相同的)存储过程。 我的 Visual Studio 服务器资源管理器和 Visual Studio SQL Server 对象资源管理器都有相同的连接字符串。

当我通过服务器资源管理器或 sql server 对象资源管理器打开文件并设置断点并开始调试时,它总是说断点不会被命中。

我还将数据库作为项目添加到我的解决方案资源管理器中,并在我的项目属性中选中了启用 sql 调试

我已阅读此How can I step into a SQL Server stored proc from my C# code? 类似问题。

如果你愿意,我可以发布存储的 proc 代码,但它不是那么相关,因为我无法进入它来调试它。

这是我的天蓝色数据库版本

Microsoft SQL Azure (RTM) - 2017 年 6 月 7 日 12.0.2000.8 01:09:35 版权所有 (C) 2017 Microsoft Corporation。版权所有。

这是我的本地数据库

Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64) 2016 年 10 月 28 日 18:17:30 版权所有 (c) Windows 10 Pro 6.3(内部版本 15063)上的 Microsoft Corporation Express Edition(64 位): )(管理程序)

运行 Visual Studio 2017 community 15.2(最新稳定版) 和云资源管理器 1.1.1704.221 和 ssms 17.1 (14.0.17119.0)

我还以管理员身份启动了 vs。也没有帮助。

我的机器上没有显示应用程序调试的第4步。不在服务器资源管理器或 sql server 对象资源管理器中。 https://www.codeproject.com/Articles/1079275/Debug-Stored-Procedures-in-Visual-Studio-and-SSMS

似乎在 localdb 上检查过。不可用作 azure sql 的选项。

当我手动想要从 ssms 运行存储过程时,Azure db 没有调试选项。

【问题讨论】:

    标签: c# stored-procedures azure-sql-database visual-studio-2017 localdb


    【解决方案1】:

    截至 2018 年 11 月,Azure SQL 不支持调试

    【讨论】:

      猜你喜欢
      • 2020-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多