Dim cmd SqlCommand= New SqlCommand("SP_deletelist", cn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New SqlParameter("@orderno", SqlDbType.NVarChar, 20))
cmd.Parameters("@orderno").Value = Gridlist.DataKeys(e.Item.ItemIndex)
cmd.Connection.Open()
Try
cmd.ExecuteNonQuery()
lblmsg.Text = "删除成功"
lblmsg.Style("COLOR") = "red"
Catch exp As SqlException
If exp.Number = 2627 Then
Else
lblmsg.Text = "记录没有被删除,请检查错误!"
End If
lblmsg.Style("Color") = "red"
Exit Sub
End Try
cmd.Connection.Close()
Gridbind()
Griddetailbind()
我怎么在cmd.ExecuteNonQuery()执行之前给出提示框,按确定后再执行,按取消就不执行? 求求大家?
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add(New SqlParameter("@orderno", SqlDbType.NVarChar, 20))
cmd.Parameters("@orderno").Value = Gridlist.DataKeys(e.Item.ItemIndex)
cmd.Connection.Open()
Try
cmd.ExecuteNonQuery()
lblmsg.Text = "删除成功"
lblmsg.Style("COLOR") = "red"
Catch exp As SqlException
If exp.Number = 2627 Then
Else
lblmsg.Text = "记录没有被删除,请检查错误!"
End If
lblmsg.Style("Color") = "red"
Exit Sub
End Try
cmd.Connection.Close()
Gridbind()
Griddetailbind()
我怎么在cmd.ExecuteNonQuery()执行之前给出提示框,按确定后再执行,按取消就不执行? 求求大家?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货