The class should support a function named Profiles which takes a ID as an Integer parameter and returns the name corresponding to that ID as a String. If the name is NULL, then the function should simply return an empty string (String.Empty). If the ID does not exist in the database, the program should throw an ArgumentException (this class is defined in the System namespace).
Public Sub Profiles(ByVal ID As Integer)
Dim cmd As New SqlCommand("SELECT ID FROM Biodata WHERE ID = @pid", Info)
Dim da As New SqlDataAdapter(cmd)
Dim dt As New DataTable
da.Fill(dt)
cmd.Parameters.Add("pid", SqlDbType.Int)
da.Fill(dt)
If txtName.text = 0 Then
txtName.text = String.Empty
End If
da.Update(dt)
If Count <> 0 Then RaiseEvent CountChanged(Me, New EventArgs)
If Average <> 0 Then RaiseEvent AverageChanged(Me, New EventArgs)