📄 解挂一.vb
字号:
Public Class 解挂一
Inherits System.Windows.Forms.Form
Dim strconn As String = "data source=.;initial catalog=weboy;user id=sa;password=;"
Dim objds As New Data.DataSet
Dim objda As SqlClient.SqlDataAdapter
Dim bingpage As BindingManagerBase
Dim sql As String
Dim cn As New SqlClient.SqlConnection
Dim cmd As SqlClient.SqlCommand
Dim str As String
Dim objcommand As SqlClient.SqlCommand
Dim objdr As SqlClient.SqlDataReader
Dim strsql As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
objds.Clear()
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MessageBox.Show("请输入完整信息!")
Exit Sub
Else
str = "select ID from CConsumers"
objcommand = New SqlClient.SqlCommand(str, New SqlClient.SqlConnection(strconn))
objcommand.Connection.Open()
objdr = objcommand.ExecuteReader(CommandBehavior.CloseConnection)
With objdr
Do While .Read = True
str = .GetString(0)
If Trim(TextBox1.Text) <> Trim(str) Then
MessageBox.Show(" 该帐户不存在,请确认帐户号码是否正确!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
Exit Sub
Else
sql = "update CConsumers set be=0 where ID='" & Trim(TextBox1.Text) & "'"
cn.ConnectionString = strconn
cn.Open()
cmd = New SqlClient.SqlCommand(sql, cn)
cmd.ExecuteNonQuery()
cmd.Dispose()
cn.Dispose()
MessageBox.Show("解挂成功!")
Me.Close()
Exit Sub
End If
Loop
End With
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -