Sub AutoQTNo()
OpenDatabase()
Dim daB As New SqlDataAdapter("Select Max(SBAIVNo) from SBAIV", Connt)
Dim dsB As New DataSet
daB.Fill(dsB, "B")
dsB.Tables(0).Clear()
daB.Fill(dsB, "B")
Dim BillNo As String
BillNo = dsB.Tables(0).Rows(0).Item(0)
BillNo = BillNo + 1
BillNo = Format(CInt(BillNo), "000000")
txtAutoNo.Text = BillNo
End Sub
Code (VB.NET)
Sub getyear()
Dim time As DateTime = DateTime.Now
Dim format As String = "yyyy"
Console.WriteLine(time.ToString(format))
txtYear.Text = (time.ToString(format))
End Sub