Solution 4
This is you can do by two ways:
1)By using Render Block- include all your code requred for database in block
<%
%>
2)by using script tag:include all ur code in button click event into this tag as follows.
<script runat="server">
sub Button_click(byval s as object, byval e as EventArgs)
Dim con as sqlconnection
dim cmd as sqlcommand
con=new sqlconnection("place ur conn string here")
cmd=new sqlacommand("select * from table", con)
dim dr as sqldatareader=cmd.executereader()
while dr.read()
response.write(dr("col name in ur table")
end while
</script>