Title: RND.Next                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
Public Class Form1
    Dim Mode As String
    Dim ID As Integer
    Sub View()
        Me.IDTextBox.ReadOnly = True
        Me.NameTextBox.ReadOnly = True
        Me.AgeTextBox.ReadOnly = True
        Me.ToolStrip1.Enabled = True
        Me.GroupBox2.Enabled = False
    End Sub
    Sub Edit()
        Me.IDTextBox.ReadOnly = True
        Me.NameTextBox.ReadOnly = False
        Me.AgeTextBox.ReadOnly = False
        Me.ToolStrip1.Enabled = False
        Me.GroupBox2.Enabled = True
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.TestTableAdapter.Fill(Me.AdventureWorksDataSet.Test)
        View()
    End Sub
    Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click
        Edit()
        Me.Mode = "Insert"
        Dim RND As New Random
        Me.IDTextBox.Text = RND.Next(99, 9999999)
        Me.NameTextBox.Clear()
        Me.AgeTextBox.Clear()
    End Sub
 
    Private Sub ToolStripButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton6.Click
        Edit()
        Me.Mode = "Update"
    End Sub
 
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.TestTableAdapter.Fill(Me.AdventureWorksDataSet.Test)
        View()
    End Sub
 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Me.Mode = "Insert" Then
            Me.TestTableAdapter.InsertQuery(Me.IDTextBox.Text, NameTextBox.Text, Me.AgeTextBox.Text)
          
        ElseIf Me.Mode = "Update" Then
            Me.TestTableAdapter.UpdateQuery(Me.NameTextBox.Text, Me.AgeTextBox.Text, Me.IDTextBox.Text)
 
        End If
        Me.TestTableAdapter.Fill(Me.AdventureWorksDataSet.Test)
        View()
    End Sub
 
    Private Sub ToolStripButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton7.Click
        Me.TestTableAdapter.DeleteQuery(Me.IDTextBox.Text)
        Me.TestTableAdapter.Fill(Me.AdventureWorksDataSet.Test)
    End Sub
End Class