Yeah. That code seem a bit cumbersome.
And you're not even using SLP, Admin or Pateint. So you can throw those away.
Also, in ASP.NET you can't use MsgBox. Add a Label and direct any output that that.
Try this instead.