Private Sub ts_add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ts_add.Click
display_show()
not_hidden_ts()
lbl_t()
Dim strCom As String = "SELECT MAX(id_please) As maxid WHERE id_please LIKE ' & %Now.Year() + 543 & /' FROM tbplease"
Com = New OleDbCommand(strCom, Conn)
Try
Conn.Open()
Dim Result As Integer = CInt(Com.ExecuteScalar())
Conn.Close()
txt_idplease.Text = Now.Year() + 543 & "/" & Convert.ToString(Result + 1)
Catch ex As Exception
txt_idplease.Text = Now.Year() + 543 & "/1"
End Try
End Sub
Dim strCom As String = "SELECT MAX([id_please]) As [maxid] WHERE [id_please] LIKE @id_please FROM [tbplease]"
Com = New OleDbCommand(strCom, Conn)
Com.Parameter.AddWithValue("@id_please", "%" & Convert.ToString(DateTime.Now.Year + 543) & "/");
Dim strCom As String = "SELECT MAX([id_please]) As [maxid] WHERE [id_please] LIKE @id_please FROM [tbplease]"
Com = New OleDbCommand(strCom, Conn)
Com.Parameter.AddWithValue("@id_please", "%" & Convert.ToString(DateTime.Now.Year + 543) & "/");