Try
Dim clsConn As SqlClient.SqlCommand
Dim da As SqlClient.SqlDataAdapter
Dim dt As DataTable = New DataTable
Dim id As Integer
Dim sql As String = "select Max(s_ID) from as s_ID Test_C_Student"
'clsConn = New connectdb;//connect database ก่อนนะครับ อย่าลืม!!!
da = New SqlClient.SqlDataAdapter(clsConn)
da.Fill(dt)
If dt.Rows.Count > 0 Then
id = Convert.ToInt16(dt.Rows(0)("s_ID").ToString())
id = id + 1
End If
Catch ex As Exception
End Try