首页 新闻 会员 周边 捐助

oracle做asp.net中的repeater修改时,报ORA-01008: not all variables bound求原因

0
悬赏园豆:20 [已关闭问题] 关闭于 2014-11-13 20:18

1.数据区

 public static int updateDetailById(BackupDetail model)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("UPDATE " + Setting.OWMER + "BACKUPDETAIL set WORKHUB=:workHub,JOBNUMBER=:jobNumber,BACKUPDESCRIPTION=:backupDescription,ORDERNO=:orderNo,FINISHTIME=:finishTime,ISWAIT=:isWait,MAERIALDESCRIPTION=:MaerialDescription,BUYTYPE=:buyType,CURRMARCH=:CurrMarch,DUTYMAN=:dutyMan,BUYPERSON=:buyPerson,BACKUPMAN=:backupMan,REMARK=:reMark where BACKUPID=:backupId");
            OracleParameter[] par = {
                                      new OracleParameter("workHub",model.WORKHUB ),
                                      new OracleParameter("jobNumber",model.JOBNUMBER),
                                      new OracleParameter("backupDescription",model.BACKUPDESCRIPTION),
                                      new OracleParameter("isWait",model.ISWAIT),
                                      new OracleParameter("MaerialDescription",model.MAERIALDESCRIPTION),
                                      new OracleParameter("buyType",model.BUYTYPE),
                                      new OracleParameter("CurrMarch",model.CURRMARCH),                                     
                                      new OracleParameter("dutyMan",model.DUTYMAN),
                                      new OracleParameter("buyPerson",model.BUYPERSON),
                                      new OracleParameter("backupMan",model.BACKUPMAN),
                                      new OracleParameter("finishTime",model.FINISHTIME),
                                      new OracleParameter("orderNo",model.ORDERNO),
                                      new OracleParameter("reMark",model.REMARK),
                                      new OracleParameter("backupId",model.BACKUPID)
                                     
                                    };

            try
            {
                return DbHelper.ExecuteNonQuery(sb.ToString(), par);
            }
            catch
            {
                throw;
            }
          
          
        }

2.修改后台区

3.页面部分修改区

  <asp:Panel ID="plEdit" runat="server">
                                        <tr>
                                            <td style="width: 30px;">
                                                <%#Container.ItemIndex+1 %>
                                            </td>
                                            <td style="display: none">
                                               
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtWorkHub" Width="60px" Text='<%# DataBinder.Eval(Container.DataItem, "WORKHUB") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtJobNumber" Width="55px" Text='<%# DataBinder.Eval(Container.DataItem, "JOBNUMBER") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtBackupDescr" Width="120px" Text='<%# DataBinder.Eval(Container.DataItem,"BACKUPDESCRIPTION") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtIsWait" Width="30px" Text='<%# DataBinder.Eval(Container.DataItem,"ISWAIT") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtBuyType" Width="80px" Text='<%#DataBinder.Eval(Container.DataItem,"BUYTYPE") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtMaerialDescr" Width="110px" Text='<%# DataBinder.Eval(Container.DataItem,"MAERIALDESCRIPTION") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlCurrMarch" Width="120px" runat="server" DataTextField='<%#DataBinder.Eval(Container.DataItem,"CURRMARCH") %>'>
                                                </asp:DropDownList>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtOrderNo" Width="60px" Text='<%# DataBinder.Eval(Container.DataItem,"ORDERNO") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtFinishTime" Width="100px" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd '})"
                                                    Text='<%# DataBinder.Eval(Container.DataItem,"FINISHTIME") %>' runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDutyMan" Width="90px" onclick="$.person.single($(this))" Text='<%# DataBinder.Eval(Container.DataItem,"DUTYMAN") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtBuyPerson" Width="90px" onclick="$.person.single($(this))" Text='<%# DataBinder.Eval(Container.DataItem,"BUYPERSON") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtBackupMan" Width="90px" onclick="$.person.single($(this))" Text='<%# DataBinder.Eval(Container.DataItem,"BACKUPMAN") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td>
                                                <img src="../Image/Green.jpg" runat="server" id="Img1" />
                                            </td>
                                            <td>
                                                <img src="../Image/Red.jpg" runat="server" id="Img2" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtReMark" Width="100px" Text='<%# DataBinder.Eval(Container.DataItem,"REMARK") %>'
                                                    runat="server"></asp:TextBox>
                                            </td>
                                            <td style="width: 90px">
                                                <asp:LinkButton runat="server" Width="45px" ID="lbtUpdate" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "BACKUPID")%>'
                                                    CommandName="Update" Text="更新"></asp:LinkButton>&nbsp;&nbsp;
                                                <asp:LinkButton runat="server" Width="45px" ID="lbtCancel" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "BACKUPID")%>'
                                                    CommandName="Cancel" Text="取消"></asp:LinkButton>
                                            </td>
                                        </tr>
                                    </asp:Panel>

问题补充:

原因找到了,就是绑定的时间值在修改时为空的情况就会报错,我要怎么可以在时间为空时,修改别的数据也可以呢?求解!

renshen4322的主页 renshen4322 | 初学一级 | 园豆:5
提问于:2014-11-11 15:59
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册