从C#ASP.NET vs 2010调试存储过程 [英] Debugging a stored procedure from C# ASP.NET vs 2010

查看:65
本文介绍了从C#ASP.NET vs 2010调试存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要从调用c#asp.net进入ms sql server存储过程。





我可以从c#应用程序然而它没有进入存储过程。





我怎样才能做到这一点?





need to step into an ms sql server stored procedure from a calling c# asp.net.


I can start debugging from c# application however it doesn't step into the stored procedure.


How can I accomplish this?


protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
      {

          ////
          //GRIDVIEW1 BEGIN

          try
          {
              //connection to the database
              //
              //
              string str;
              str = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
              SqlConnection sqlcon = new SqlConnection(str);

              string intno;

              //Get the intno
              intno = GridView1.SelectedRow.Cells[1].Text;

              //call the stored procedure
              SqlCommand SqlCmd = new SqlCommand("sp_GetDisbursedt", sqlcon);
              SqlCmd.CommandType = System.Data.CommandType.StoredProcedure;

              //Supply the User_id parameter
              SqlCmd.Parameters.AddWithValue("@ZAPPRAISAL", intno);

 

              //Open the sql data connection
              sqlcon.Open();

              //Execute the stored procedures
              SqlCmd.ExecuteNonQuery();









在项目的属性窗口中,我找不到





调试* 在左侧列表中。在应用程序下。



你怎么得到调试回来



请给出步骤。



谢谢





















请协助



我尝试了什么:



我检查了互联网无济于事





In the project's properties window, I cannot find


"Debug* in the list on the left. Under Applications.

How do you get the "Debug" back

Pleae give the steps.

Thanks










Please assist

What I have tried:

I have checked the internet to no avail

推荐答案

这里是MSDN从Visual Studio调试存储过程的链接。



https://support.microsoft.com/en -us / kb / 316549 [ ^ ]



演练:调试Transact-SQL存储过程 [ ^ ]
here's the link from MSDN for debugging stored procedure from Visual Studio.

https://support.microsoft.com/en-us/kb/316549[^]

Walkthrough: Debug a Transact-SQL Stored Procedure[^]


Please debug your stored procedure in management studio like visual studio code debugging.

DECLARE	@comname AS	varchar(100)
DECLARE	@commes	AS	varchar(100)
DECLARE	@job	AS	varchar(50)
DECLARE	@name	AS	varchar(200)
DECLARE	@add1	AS	varchar(200)
DECLARE	@add2	AS	varchar(200)
DECLARE	@add3	AS	varchar(200)
DECLARE	@phone	AS	varchar(10)
DECLARE	@fax	AS	varchar(100)
DECLARE	@email	AS	varchar(100)


SET	@comname =''
SET	@commes	=''	
SET	@job=''	
SET	@name	=''
SET	@add1=''	
SET	@add2=''	
SET	@add3	=''	
SET	@phone	=''	
SET	@fax	=''	
SET	@email	=''	

-- ALTER proc [dbo].[cards]
--(
--	@comname	varchar(100),
--	@commes	varchar(100),
--	@job	varchar(50),
--	@name	varchar(200),
--	@add1	varchar(200),
--	@add2	varchar(200),
--	@add3	varchar(200),
--	@phone	varchar(10),
--	@fax	varchar(100),
--	@email	varchar(100)
--)
--as
begin
insert into card1 (comname,commes,job,name,add1,add2,add3,phone,fax,email)
values (@comname,@commes,@job,@name,@add1,@add2,@add3,@phone,@fax,@email)	
end


这篇关于从C#ASP.NET vs 2010调试存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆