poojavb 29 Junior Poster

ok thank you, i will try this

U can try this too for a alphanumeric or if u need only numeric increment then delete the red part

Try
            Dim myCommand As SqlCommand
            Dim STid As String
            myCommand = New SqlCommand("select ISNULL(Max(SUBSTRING(id,4,7)),0) From Studentreg", Connection)
            Dim reader As SqlDataReader = myCommand.ExecuteReader
            reader.Read()
            STid= reader.Item(0) + 1
            Textbox1.Text = "ST" +  STid.ToString()
            reader.Close()
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
poojavb 29 Junior Poster

Im trying to put current system time in YYMMDD format but having problem with day function.
is Day() which returned day of month in VB6 not available in VB.Net?
If I want to get the current day of month, how would I do that?

Dim dt As Date
Dim dtString As String

dtString = Year(now()) + Month(now()) + Day(now())

Use the below code so that u can get the system date

Dim d As String = Format(Today, "yy/MM/dd")
TextBox1.Text = d