Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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?


C#
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
Posted
Updated 9-Aug-16 21:10pm
v4

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[^]
 
Share this answer
 
SQL
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900