<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 586px">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="AccessDataSource1"
style="z-index: 1; left: 493px; top: 165px; position: absolute; height: 233px; width: 620px; margin-left: 76px; margin-right: 61px">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:BoundField DataField="NA_NAME" HeaderText="NA_NAME"
SortExpression="NA_NAME" />
<asp:BoundField DataField="2015/1/1" HeaderText="2015/1/1"
SortExpression="2015/1/1" />
<asp:BoundField DataField="2015/2/1" HeaderText="2015/2/1"
SortExpression="2015/2/1" />
<asp:BoundField DataField="2015/4/1" HeaderText="2015/4/1"
SortExpression="2015/4/1" />
<asp:BoundField DataField="2015/5/1" HeaderText="2015/5/1"
SortExpression="2015/5/1" />
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
ConflictDetection="CompareAllValues" DataFile="~/vqa mdb/ceshi.accdb"
DeleteCommand="DELETE FROM [T_shuju] WHERE [sj_ID] = ? AND (([sj_shuju] = ?) OR ([sj_shuju] IS NULL AND ? IS NULL)) AND (([sj_DTID] = ?) OR ([sj_DTID] IS NULL AND ? IS NULL)) AND (([sj_NAID] = ?) OR ([sj_NAID] IS NULL AND ? IS NULL)) AND (([sj_YRID] = ?) OR ([sj_YRID] IS NULL AND ? IS NULL))"
InsertCommand="INSERT INTO [T_shuju] ([sj_ID], [sj_shuju], [sj_DTID], [sj_NAID], [sj_YRID]) VALUES (?, ?, ?, ?, ?)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="TRANSFORM Max(T_shuju.sj_shuju) AS sj_shuju之最大值
SELECT T_name.NA_NAME
FROM T_year INNER JOIN (T_name INNER JOIN (T_date INNER JOIN T_shuju ON T_date.DT_ID = T_shuju.sj_DTID) ON T_name.NA_ID = T_shuju.sj_NAID) ON T_year.YR_ID = T_shuju.sj_YRID
GROUP BY T_name.NA_NAME
PIVOT T_date.DT_riqi;"
UpdateCommand="UPDATE [T_shuju] SET [sj_shuju] = ? WHERE (([sj_shuju] = ?) OR ([sj_shuju] IS NULL AND ? IS NULL))">
<DeleteParameters>
<asp:Parameter Name="original_sj_ID" Type="Int32" />
<asp:Parameter Name="original_sj_shuju" Type="Int32" />
<asp:Parameter Name="original_sj_shuju" Type="Int32" />
<asp:Parameter Name="original_sj_DTID" Type="Int32" />
<asp:Parameter Name="original_sj_DTID" Type="Int32" />
<asp:Parameter Name="original_sj_NAID" Type="Int32" />
<asp:Parameter Name="original_sj_NAID" Type="Int32" />
<asp:Parameter Name="original_sj_YRID" Type="Int32" />
<asp:Parameter Name="original_sj_YRID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="sj_ID" Type="Int32" />
<asp:Parameter Name="sj_shuju" Type="Int32" />
<asp:Parameter Name="sj_DTID" Type="Int32" />
<asp:Parameter Name="sj_NAID" Type="Int32" />
<asp:Parameter Name="sj_YRID" Type="Int32" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="sj_shuju" Type="Int32" />
<asp:Parameter Name="sj_DTID" Type="Int32" />
<asp:Parameter Name="sj_NAID" Type="Int32" />
<asp:Parameter Name="sj_YRID" Type="Int32" />
<asp:Parameter Name="original_sj_ID" Type="Int32" />
<asp:Parameter Name="original_sj_shuju" Type="Int32" />
<asp:Parameter Name="original_sj_shuju" Type="Int32" />
<asp:Parameter Name="original_sj_DTID" Type="Int32" />
<asp:Parameter Name="original_sj_DTID" Type="Int32" />
<asp:Parameter Name="original_sj_NAID" Type="Int32" />
<asp:Parameter Name="original_sj_NAID" Type="Int32" />
<asp:Parameter Name="original_sj_YRID" Type="Int32" />
<asp:Parameter Name="original_sj_YRID" Type="Int32" />
</UpdateParameters>
</asp:AccessDataSource>
</div>
</form>
</body>
</html>
以上是页面代码 sql语句已经写了 但是更新没用
------解决思路----------------------
要简单的话,你的方法也属于简单的方法,不用写什么增删改查的代码了。
你之前不能更新,你要看看UpdateParameters里面的参数设的有没有问题,顺序是最关键的,并且参数应该是3个,你里面怎么设了那么多参数?