i try to approved documents here is code
protected void GrdFileApprove_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "_Approve")
{
//using (SqlConnection con = DataAccess.GetConnected())
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mydms"].ConnectionString))
{
try
{
int rowindex = Convert.ToInt32(e.CommandArgument);
GridViewRow row = (GridViewRow)((Control)e.CommandSource).NamingContainer;
LinkButton Prove_Button = (LinkButton)row.FindControl("BtnApprove");
SqlCommand cmd = new SqlCommand("spinsertapprove", con);
cmd.CommandType = CommandType.StoredProcedure;
int result = cmd.ExecuteNonQuery();
if (result != 0)
{
GrdFileApprove.DataBind();
}
}
catch (Exception ex)
{
}
finally
{
con.Close();
}
}
}
else if (e.CommandName == "_Reject")
{
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mydms"].ConnectionString))
{
try
{
int rowindex = Convert.ToInt32(e.CommandArgument);
GridViewRow row = (GridViewRow)((Control)e.CommandSource).NamingContainer;
LinkButton Prove_Button = (LinkButton)row.FindControl("Button1");
SqlCommand cmd = new SqlCommand("sprejectapprove", con);
cmd.CommandType = CommandType.StoredProcedure;
int result = cmd.ExecuteNonQuery();
if (result != 0)
{
GrdFileApprove.DataBind();
}
}
catch (Exception ex)
{
}
finally
{
con.Close();
}
}
here is query
create procedure sprejectapprove
@UserID int,
@DocID int,
@ApproveType nvarchar(50)
as
Insert into Approval(UserID,DocID,ApproveType)
values(@UserID,@DocID,@ApproveType)
create procedure spinsertapprove
@UserID int,
@DocID int,
@ApproveType nvarchar(50)
as
Insert into Approval(UserID,DocID,ApproveType)
values(@UserID,@DocID,@ApproveType)
when i debug the code and click an approve button there is not any responce .....and any data not goes to database
in database i have a seprate approval table in which
userid,docid,approve type columns invlove
please help