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