You may want to consider using prepared statement instead of the â¦
Dim sqlcommand As New SqlCommand("SELECT SID FROM students WHERE SNAME= '" & DropDownList1.Text & "'", dbconnection)
It is vulnerable to Sql injection (if this is a web app) and the statement will fail if the DropwonList1.Text contain an apostrophe (â).
May not be a big issue in this case but in general you should be careful about stringing together SQL statements. Personally I do it from time to time, but then I use a general purpose function that takes care of the single apostrophe issue.
Best Regards
Georg Jansen
http://www.l4ndash.com - Log4net Dashboard and Log Viewer