i have a problem generating auto number. can someone help me to solve this?
here is my code
Try
If IsConnected() = True Then
strSQL = "Select max(*) from Supplier"
End If
myCmd.CommandText = strSQL
myCmd.Connection = myConn
myDA.SelectCommand = myCmd
myDR = myCmd.ExecuteReader()
If myDR.HasRows Then
Label5.Text = myDR.Item(0)
Else
Label5.Text = myDR.Item(0) + 1
End If
Catch ex As Exception
End Try