C# 从Visual Studio 2017进入存储过程SQL Azure
Visual Studio 2017社区版使用以下代码在myC# 从Visual Studio 2017进入存储过程SQL Azure,c#,stored-procedures,azure-sql-database,visual-studio-2017,localdb,C#,Stored Procedures,Azure Sql Database,Visual Studio 2017,Localdb,Visual Studio 2017社区版使用以下代码在myExecuteScalar或ExecuteOnQuery上执行步骤: using (var con = new SqlConnection(ConfigurationManager.ConnectionStrings["DataContext"].ConnectionString)) { con.Open(); var sc = new SqlCommand("InsertOrUpdate", con); sc.
ExecuteScalar
或ExecuteOnQuery
上执行步骤:
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 datacontext中有一个azure sql server,还有一个localdbserver=(localdb)\MSSQLLocalDB;集成安全=真
两者都不进入(同一)存储过程。
我在Visual Studio Server资源管理器和Visual Studio SQL Server对象资源管理器中都有相同的连接字符串
当我通过服务器资源管理器或sql server对象资源管理器打开文件并设置断点并开始调试时,它总是说不会命中断点
我还将数据库作为项目添加到解决方案资源管理器中,并在“我的项目”属性中选中了“启用sql调试”
我读过类似的问题
如果您愿意,我可以发布存储的过程代码,但它不是那么相关,因为我无法进入它进行调试
这是我的azure db版本
Microsoft SQL Azure(RTM)-12.0.2000.8 2017年6月7日01:09:35版权所有2017年Microsoft Corporation。版权所有
这是我的localdb
Microsoft SQL Server 2016(SP1)(KB3182545)-13.0.4001.0(X64)2016年10月28日18:17:30版权所有(c)Windows 10 Pro 6.3上的Microsoft Corporation Express Edition(64位)(构建15063:)(管理程序)
运行Visual Studio 2017社区15.2(最新版本)
和云资源管理器1.1.1704.221
和ssms 17.1(14.0.17119.0)
我还以管理员的身份启动了vs。也无济于事
我的机器上没有显示应用程序调试的步骤4。不在服务器资源管理器或sql server对象资源管理器中
似乎在localdb检查过。作为azure sql的选项不可用
另外,当我手动希望从SSM运行存储的进程时,azure db没有调试选项
当前截至2018年11月,Azure SQL不支持调试