Connexion sql server via asp.net
Fermé
futurSommetPHP
Messages postés
24
Date d'inscription
mardi 18 mai 2010
Statut
Membre
Dernière intervention
12 novembre 2010
-
Modifié par futurSommetPHP le 10/06/2010 à 11:59
Emlina - 5 mars 2012 à 22:32
Emlina - 5 mars 2012 à 22:32
A voir également:
- Connexion sql server via asp.net
- Formate pour taxer client connexion ✓ - Forum Matériel informatique
- Scp server - Forum Jeux vidéo
- Instagram connexion - Guide
- Communication impossible via ssl ps4 ✓ - Forum Google Chrome
- Facebook connexion - Guide
2 réponses
futurSommetPHP
Messages postés
24
Date d'inscription
mardi 18 mai 2010
Statut
Membre
Dernière intervention
12 novembre 2010
11 juin 2010 à 10:02
11 juin 2010 à 10:02
<%@ 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=MonServer;"
strConnection += "Connect Timeout=30"
data_src.text = strConnection
Dim objConnection as New SqlConnection ( strConnection )
try
objConnection.Open ()
con_open.text= "Connection ouverte avec succès.<br />"
objConnection.Close ()
con_close.text= "Connection fermée.<br />"
catch e as Exception
con_open.text= "Erreur lors de l'ouverture.<br />"
con_close.text=e.ToString ()
end try
end Sub
</script>
< html >
<body>
<h4>Testing the data connection </h4>
<asp:label id= "data_src" runat= "server" /></h4>
<asp:label id= "con_open" runat= "server" /><br />
<asp:label id= "con_close" runat= "server" /><br />
</ body >
</ html >
Merci pour ceux qui ont éssayé de m'aider