关于greedview更新的一个问题

yu_lei320 2006-11-02 11:26:33
我在程序中使用了一个greedview,但是,进入编辑状态修改之后,数据并没有任何改动,这是为什么啊?我已经设置了DatakeyNames属性,也在配置数据源的时候自动生成了update语句,还有什么地方需要设置的么?请各位高手给些指点
...全文
89 6 打赏 收藏 举报
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xzr2004 2006-11-02
  • 打赏
  • 举报
回复
你没有<UpdateParameters></UpdateParameters>
DePaul 2006-11-02
  • 打赏
  • 举报
回复
没有<UpDateParameters>
yu_lei320 2006-11-02
  • 打赏
  • 举报
回复
下面是我的所有的关于gridview和数据源的代码
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3" DataKeyNames="ZiDong" DataSourceID="SqlDataSource1" AllowPaging="True" AllowSorting="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" Height="136px" Width="744px">
<Columns>
<asp:BoundField DataField="JiQiBH" HeaderText="机器编号" ReadOnly="True" SortExpression="JiQiBH" />
<asp:BoundField DataField="SongXiuSJ" HeaderText="送修时间" SortExpression="SongXiuSJ" />
<asp:BoundField DataField="ChuLiJG" HeaderText="处理结果" SortExpression="ChuLiJG" />
<asp:BoundField DataField="JinE" HeaderText="金额" SortExpression="JinE" />
<asp:BoundField DataField="PeiJianLY" HeaderText="配件来源" SortExpression="PeiJianLY" />
<asp:CommandField ShowEditButton="True" />
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</asp:GridView>
     <br />
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:JingQueHGLConnectionString8 %>"
SelectCommand="SELECT * FROM [JiQiWHQKB] WHERE (([SuoShuD] = @SuoShuD) AND ([SuoShuBM] = @SuoShuBM) AND ([JiQiBH] = @JiQiBH))" ProviderName="<%$ ConnectionStrings:JingQueHGLConnectionString4.ProviderName %>" UpdateCommand="UPDATE [JiQiWHQKB] SET [JiQiBH] = @JiQiBH, [SuoShuD] = @SuoShuD, [SuoShuBM] = @SuoShuBM, [SongXiuSJ] = @SongXiuSJ, [SongXiuYY] = @SongXiuYY, [WeiXiuWB] = @WeiXiuWB, [WeiXiuWCSJ] = @WeiXiuWCSJ, [BaoXiuY] = @BaoXiuY, [XiaoDanY] = @XiaoDanY, [ChuLiJG] = @ChuLiJG, [BeiYong1] = @BeiYong1, [BeiYong2] = @BeiYong2, [GengHuanPJ] = @GengHuanPJ, [JinE] = @JinE, [PeiJianLY] = @PeiJianLY WHERE [ZiDong] = @original_ZiDong AND [JiQiBH] = @original_JiQiBH AND [SuoShuD] = @original_SuoShuD AND [SuoShuBM] = @original_SuoShuBM AND [SongXiuSJ] = @original_SongXiuSJ AND [SongXiuYY] = @original_SongXiuYY AND [WeiXiuWB] = @original_WeiXiuWB AND [WeiXiuWCSJ] = @original_WeiXiuWCSJ AND [BaoXiuY] = @original_BaoXiuY AND [XiaoDanY] = @original_XiaoDanY AND [ChuLiJG] = @original_ChuLiJG AND [BeiYong1] = @original_BeiYong1 AND [BeiYong2] = @original_BeiYong2 AND [GengHuanPJ] = @original_GengHuanPJ AND [JinE] = @original_JinE AND [PeiJianLY] = @original_PeiJianLY" ConflictDetection="CompareAllValues" DeleteCommand="DELETE FROM [JiQiWHQKB] WHERE [ZiDong] = @original_ZiDong AND [JiQiBH] = @original_JiQiBH AND [SuoShuD] = @original_SuoShuD AND [SuoShuBM] = @original_SuoShuBM AND [SongXiuSJ] = @original_SongXiuSJ AND [SongXiuYY] = @original_SongXiuYY AND [WeiXiuWB] = @original_WeiXiuWB AND [WeiXiuWCSJ] = @original_WeiXiuWCSJ AND [BaoXiuY] = @original_BaoXiuY AND [XiaoDanY] = @original_XiaoDanY AND [ChuLiJG] = @original_ChuLiJG AND [BeiYong1] = @original_BeiYong1 AND [BeiYong2] = @original_BeiYong2 AND [GengHuanPJ] = @original_GengHuanPJ AND [JinE] = @original_JinE AND [PeiJianLY] = @original_PeiJianLY" InsertCommand="INSERT INTO [JiQiWHQKB] ([JiQiBH], [SuoShuD], [SuoShuBM], [SongXiuSJ], [SongXiuYY], [WeiXiuWB], [WeiXiuWCSJ], [BaoXiuY], [XiaoDanY], [ChuLiJG], [BeiYong1], [BeiYong2], [GengHuanPJ], [JinE], [PeiJianLY]) VALUES (@JiQiBH, @SuoShuD, @SuoShuBM, @SongXiuSJ, @SongXiuYY, @WeiXiuWB, @WeiXiuWCSJ, @BaoXiuY, @XiaoDanY, @ChuLiJG, @BeiYong1, @BeiYong2, @GengHuanPJ, @JinE, @PeiJianLY)" OldValuesParameterFormatString="original_{0}">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="SuoShuD" PropertyName="SelectedValue"
Type="String" />
<asp:ControlParameter ControlID="DropDownList2" Name="SuoShuBM" PropertyName="SelectedValue"
Type="String" />
<asp:ControlParameter ControlID="TextBox1" Name="JiQiBH" PropertyName="Text" Type="String" />
</SelectParameters>
yu_lei320 2006-11-02
  • 打赏
  • 举报
回复
没有代码,
全部是用vs2005拉出来的唯一的代码就是一句databind()
Eddie005 2006-11-02
  • 打赏
  • 举报
回复
贴出代码~
yu_lei320 2006-11-02
  • 打赏
  • 举报
回复
当然有啊
是由vs2005自动生成的,因为太长了,就没往上贴了
发帖
.NET社区

6.1w+

社区成员

.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
帖子事件
创建了帖子
2006-11-02 11:26
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。