⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 挂失1.vb

📁 银行帐户管理系统
💻 VB
字号:
Public Class 挂失1
    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 i As Integer = 3

    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=1 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 + -