📄 修改删除(未).aspx.vb
字号:
Imports System.Data
Imports System.Data.SqlClient
Partial Class CourseSearch_DB
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
'Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
' Dim coon As New SqlConnection("Server=localhost;Database=选修课管理系统;Uid=sa;Pwd=;")
' ' Dim cmd As New SqlCommand("select * from 课程表 where 开课学期 ='" & Trim(DropDownList1.SelectedItem.Text) & " ' and 课程号='" & Trim(DropDownList2.SelectedItem.Text) & "'", coon)
' coon.Open()
' Dim dr As SqlDataReader = cmd.ExecuteReader()
' GridView1.DataSource = dr
' GridView1.DataBind()
' coon.Close()
'End Sub
'Dim strsql As String
'Dim coon As New SqlConnection("Server=localhost;Database=选修课管理系统;Uid=sa;Pwd=;")
'strsql = "delete from where 课程号='" ________ "' "
'Dim cmd As New SqlCommand(strsql, coon)
'coon.Open()
'cmd.ExecuteNonQuery()//////
'Dim dr As SqlDataReader = cmd.ExecuteReader()
'GridView1.DataSource = dr
'GridView1.DataBind()
'coon.Close()
'Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
' Response.Redirect("StudentAdd_DB1.aspx") '新建页
'End Sub
'Dim strsql As String
'Dim coon As New SqlConnection("Server=localhost;Database=选修课管理系统;Uid=sa;Pwd=;")
'strsql = "Update 表 set 列名 =(Valu) '" ________ "' "
'Dim cmd As New SqlCommand(strsql, coon)
'coon.Open()
'cmd.ExecuteNonQuery()
'Dim dr As SqlDataReader = cmd.ExecuteReader()
'GridView1.DataSource = dr
'GridView1.DataBind()
'coon.Close()
'Dim strsql As String
'Dim coon As New SqlConnection("Server=localhost;Database=选修课管理系统;Uid=sa;Pwd=;")
'strsql = "insert 表 set Values() '" ________ "' "
'Dim cmd As New SqlCommand(strsql, coon)
'coon.Open()
'cmd.ExecuteNonQuery()
'Dim dr As SqlDataReader = cmd.ExecuteReader()
'GridView1.DataSource = dr
'GridView1.DataBind()
'coon.Close()
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim key As String
key = TextBox1.Text.Trim()
Dim coon As New SqlConnection("Server=localhost;Database=选修课管理系统;Uid=sa;Pwd=;")
coon.Open()
Dim da As New SqlDataAdapter("Select * from 课程表 where 课程号 like '%" + key + "%' or 课程名 like '%" + key + "%' or 学分 like '%" + key + "%' or 学时 like '%" + key + "%' or 上课时间 like '%" + key + "%' or 上课地点 like '%" + key + "%' or 开课学期 like '%" + key + "%'", coon)
Dim ds As New DataSet()
da.Fill(ds)
dg.DataSource = ds
dg.DataBind()
coon.Close()
End Sub
' protected void delete(object source, DataGridCommandEventArgs e)
'{
' SqlConnection con = new SqlConnection("server=.;database=图书库存管理系统;uid=sa;pwd=");
' con.Open();
' String h = "DELETE FROM 客户表 where 客户编号='" + dg.DataKeys[e.Item.ItemIndex] + "'";
' SqlCommand activecm = new SqlCommand(h, con);
' activecm.ExecuteNonQuery();
' con.Close();
' DataBind();
'}
'Protected Sub delete(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg.DeleteCommand
' 'Dim a As String
' Dim strsql As String
' strsql = "delete from 课程表 where 课程号 ="
' Dim coon As New SqlConnection("Server=localhost;Database=选修课管理系统;Uid=sa;Pwd=;")
' coon.Open()
' Dim cmd As New SqlCommand(strsql, coon)
' 'strsql = "delete from where 课程号='" "'"
' dg.ToString()
' cmd.ExecuteNonQuery()
' coon.Close()
' coon.Open()
' Dim da As New SqlDataAdapter("Select * from 课程表 ", coon)
' Dim ds As New DataSet()
' da.Fill(ds)
' dg.DataSource = ds
' dg.DataBind()
' coon.Close()
'End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -