Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / VB

Solo Button Application

2.60/5 (4 votes)
19 Apr 2010CPOL 1  
Public Class Form1 '********************************************************************************************************************************* 'I am just printing messagebox 'you can replace this with other calling values 'for eg. Dim com As New OleDbCommand ' ...
VB
Public Class Form1
    '*********************************************************************************************************************************
    'I am just printing messagebox
    'you can replace this with other calling values
    'for eg. Dim com As New OleDbCommand
    '        com.Connection = con
    '        com.CommandText = "insert into members values(" & Val(TextBox1.Text) & ",'" & TextBox2.Text & "','" & _
    '                            TextBox3.Text & "','" & ComboBox1.Text & "'," & CheckBox1.Checked & "," & CheckBox2.Checked & "," & _
    'DateTimePicker1.Text & "," & DateTimePicker2.Text & ",'" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & _
    '"','" & TextBox7.Text & "'," & DateTimePicker3.Text & ",'" & TextBox8.Text & "','" & TextBox9.Text & "')"
    '        com.ExecuteNonQuery()
    '        MsgBox("Record Inserted")
    'same with delete and update & so on......
    '*********************************************************************************************************************************
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
         If Button1.Text = "Add" Then
            MsgBox("Record Inserted")
            Button1.Text = "Update"
        ElseIf Button1.Text = "Update" Then
            MsgBox("Record Modified")
            Button1.Text = "Delete"
        Else
            MsgBox("Record Removed")
            Button1.Text = "Add"
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Close()
    End Sub
End Class

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)