sqlinsert.aspx

来自「asp.net技术内幕的书配源码」· ASPX 代码 · 共 15 行

ASPX
15
字号
<%@ Import Namespace="System.Data.SqlClient" %>
<%
Dim conNorthwind As SqlConnection
Dim strInsert As String
Dim cmdInsert As SqlCommand

conNorthwind = New SqlConnection( "Server=localhost;UID=sa;PWD=secret;database=Northwind" )
strInsert = "Insert Products ( ProductName, UnitPrice ) Values ( 'Milk', 12.45 )"
cmdInsert = New SqlCommand( strInsert, conNorthwind )
conNorthwind.Open()
cmdInsert.ExecuteNonQuery()
conNorthwind.Close()
%>
New Product Added!

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?