📄 del.aspx
字号:
<%@ Page Language="VB"%>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="system.configuration" %>
<%@ import Namespace="System.Data.SqlClient" %>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
If IsNothing(request.cookies("chkadmin")) Then
response.redirect("login.aspx")
else
deldata()
end if
End Sub
sub deldata()
dim titleid as Integer
titleid=Convert.ToInt32(Request.QueryString("id"))
Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim InsertCmd As String = "delete from gbdb where id = @id"
Dim myCommand As New SqlCommand(InsertCmd, myConnection)
MyCommand.Parameters.Add(New SqlParameter("@id", SqlDbType.Int, 4))
MyCommand.Parameters("@id").Value = titleid
myCommand.Connection.Open()
myCommand.ExecuteNonQuery()
myCommand.Connection.Close()
response.redirect("default.aspx")
end sub
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -