温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SqlHelper源码及使用实例
当前文件:
SqlHelper/ExcuteSQLParm.aspx,打开代码结构图
SqlHelper/ExcuteSQLParm.aspx,打开代码结构图1<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ExcuteSQLParm.aspx.cs" Inherits="ExcuteSQLParm" %> 2
3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 4
5
<html xmlns="http://www.w3.org/1999/xhtml" > 6
<head runat="server"> 7
<title>执行带参数的Sql语句</title> 8
</head> 9
<body> 10
<form id="form1" runat="server"> 11
<div> 12
<table style="width: 470px; height: 159px"> 13
<tr> 14
<td> 15
参数名:<asp:TextBox ID="txtparm" runat="server" Width="256px" Text="id"></asp:TextBox></td> 16
</tr> 17
<tr> 18
<td> 19
参数值:<asp:TextBox ID="txtvalue" runat="server" Width="252px" Text="2"></asp:TextBox></td> 20
</tr> 21
<tr> 22
<td> 23
要执行的语句:</td> 24
</tr> 25
<tr> 26
<td> 27
<asp:TextBox ID="txtsql" runat="server" Width="438px" Text="update myTable set name='my51aspx' where id=@id"></asp:TextBox></td> 28
</tr> 29
<tr> 30
<td> 31
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="执行" Width="116px" /></td> 32
</tr> 33
</table> 34
35
</div> 36
</form> 37
</body> 38
</html> 39



