📄 openexplicit.aspx
字号:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<script language="VB" runat="server">
Dim myConnection As OleDbConnection
Dim SQL as String
Dim ConnStr as String
Sub Page_Load(Source As Object, E As EventArgs)
ConnStr = "Provider=SQLOLEDB; Data Source=(local); Initial Catalog=ASPNET;User ID=sa;"
myConnection = New OleDbConnection(ConnStr)
try
Dim mycommand As New OleDbCommand(sql,myConnection)
myConnection.Open()
Response.Write("Opened Connection to " + MyConnection.ConnectionString + "<br>")
catch myException as Exception
Response.Write("Exception: " + myException.ToString())
finally
'Close the connection explicitly
Response.Write("Closed Connection. It is important to close connections explicitly.")
myConnection.Close()
end try
End Sub
</script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -