📄 sqldstransaction.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="sqldsTransaction.aspx.cs" Inherits="sqldsTransaction" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table style="width: 300px; height: 221px">
<tr>
<td style="width: 100px">
<asp:Label ID="txtFirstNameCap" runat="server" Text="姓氏:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
<asp:Label ID="txtLastNameCap" runat="server" Text="名字:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="txtLastName" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
<asp:Label ID="txtCityCap" runat="server" Text="县市:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="txtCity" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
<asp:Label ID="txtAddressCap" runat="server" Text="住址:"></asp:Label></td>
<td style="width: 100px">
<asp:TextBox ID="txtAddress" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2">
<asp:Button ID="btnInsert" runat="server" OnClick="btnInsert_Click" Text="添加员工资料" /></td>
</tr>
</table>
</div>
<asp:SqlDataSource ID="sqldsEmployees" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
InsertCommand="INSERT INTO Employees(FirstName, LastName, City, Address) VALUES (@paramFirstName,@paramLastName,@paramCity,@paramAddress)"
OnInserted="sqldsEmployees_Inserted" OnInserting="sqldsEmployees_Inserting" ProviderName="<%$ ConnectionStrings:NorthwindConnectionString.ProviderName %>">
<InsertParameters>
<asp:ControlParameter ControlID="txtFirstName" DefaultValue="" Name="paramFirstName"
PropertyName="Text" />
<asp:ControlParameter ControlID="txtLastName" Name="paramLastName" PropertyName="Text" />
<asp:ControlParameter ControlID="txtCity" Name="paramCity" PropertyName="Text" />
<asp:ControlParameter ControlID="txtAddress" Name="paramAddress" PropertyName="Text" />
</InsertParameters>
</asp:SqlDataSource>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -