1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| <%@ import Namespace= "System.Data" %>
<%@ import Namespace= "System.Data.SqlClient" %>
<script language= "VB" runat= "server" >
Sub Page_Load ()
Dim strConnection as String = "user id=sa;password=toto;"
strConnection += "database=MaBase;server=MyServer;"
strConnection += "Connect Timeout=30"
Dim objConnection as New SqlConnection ( strConnection )
try
objConnection.Open ()
' Ici je ce sont les requetes suivant les pages'
objConnection.Close ()
catch e as Exception
con_close.text=e.ToString ()
end try
</script> |