asp.net - ItemUpdating NewValues Missing Parameter -


i have formview several data items works except single parameter not update rest of them. formview's datasource updateparameter set nothing can handle update in codebehind. every item works fine, except 1 parameter ("salesprice") missing in oldvalues , newvalues argument of itemupdating event of formview. data pull in textbox should, formatted , all.

i've attached html, sql (for getloandata()), , codebehind.

why every parameter exist in new/oldvalue arguments except "salesprice" parameter? i've tried populating textbox without formatstring, , it's still missing. there money sql datatype might cause problem?

html:

<asp:formview id="fvloandetails" runat="server" datakeynames="orderid"  datasourceid="sqlloandetails" width="100%"> <itemtemplate>     ... </itemtemplate> <edititemtemplate>     <table class="ordersectionheader">         <tr>             <td style="padding-left:10px;">                 <h2>loan details</h2>             </td>             <td style="text-align:right;">                     <asp:button id="btncancel" runat="server" text="cancel" commandname="cancel" />                 <asp:button id="bvnsave" runat="server" text="save" commandname="update" />             </td>         </tr>     </table>     <table class="ordersection">         <tr>             <td class="orderheader" style="vertical-align:top;">                 loan number             </td>             <td>                 <asp:label id="lblloannumber" cssclass="orderdata" runat="server"                      text='<%# bind("loannumber") %>' />             </td>         </tr>         <tr>             <td class="orderheader">                 business channel             </td>             <td>                 <asp:dropdownlist id="ddlbusinesschannel" runat="server"                      datasourceid="sqlbusinesschannels" datatextfield="businesschannel"                      datavaluefield="businesschannel" selectedvalue='<%# bind("businesschannel") %>'>                 </asp:dropdownlist>                                                 <asp:sqldatasource id="sqlbusinesschannels" runat="server"                      connectionstring="<%$ connectionstrings:jade_4 %>"                      selectcommand="select distinct [businesschannel] [loans] order [businesschannel]">                 </asp:sqldatasource>                                             </td>         </tr>         <tr>             <td class="orderheader">                 loan type             </td>             <td>                 <asp:dropdownlist id="ddlloantype" runat="server"                      datasourceid="sqlloantype" datatextfield="loantype"                      datavaluefield="loantype" selectedvalue='<%# bind("loantype") %>'>                 </asp:dropdownlist>                                                 <asp:sqldatasource id="sqlloantype" runat="server"                      connectionstring="<%$ connectionstrings:jade_4 %>"                      selectcommand="select distinct [loantype] [loans] order [loantype]">                 </asp:sqldatasource>               </td>         </tr>         <tr>             <td class="orderheader">                 purpose             </td>             <td>                 <asp:dropdownlist id="ddlpurpose" runat="server"                      selectedvalue='<%# bind("purpose") %>'>                     <asp:listitem text="purchase" value="false" />                     <asp:listitem text="refinance" value="true" />                 </asp:dropdownlist>                           </td>         </tr>         <tr id="trsalesprice" runat="server">             <td class="orderheader">                 sales price             </td>             <td>                 <asp:textbox id="txtsalesprice" cssclass="orderdata" runat="server" width="100"                     text='<%# bind("salesprice", "{0:f2}") %>' />             </td>         </tr>         <tr>             <td class="orderheader">                 borrower             </td>             <td>                 <table cellspacing="0">                     <tr style="font-size:8pt;padding-bottom:0px;">                         <td>first</td><td>last</td>                     </tr>                     <tr>                         <td>                             <asp:textbox id="txtbfirst" cssclass="orderdata" runat="server" width="80"                                  text='<%# bind("firstname") %>' />                         </td>                         <td>                             <asp:textbox id="txtblast" cssclass="orderdata" runat="server" width="120"                                  text='<%# bind("lastname") %>' />                         </td>                     </tr>                 </table>             </td>         </tr>         <tr>             <td class="orderheader">                 borrower email             </td>             <td>                 <asp:textbox id="txtemail" cssclass="orderdata" runat="server" width="200"                     text='<%# bind("email") %>' />             </td>         </tr>         <tr>             <td class="orderheader" style="vertical-align:top;">                 mailing address             </td>             <td>                 <table cellspacing="0">                     <tr style="font-size:8pt;padding-bottom:0px;">                         <td colspan="3">address</td>                     </tr>                     <tr>                         <td colspan="3">                             <asp:textbox id="txtaddress" cssclass="orderdata" runat="server" width="200"                                  text='<%# bind("address") %>' />                         </td>                     </tr>                     <tr style="font-size:8pt;padding-bottom:0px;">                         <td>city</td><td>state</td><td>zip</td>                     </tr>                     <tr>                         <td>                             <asp:textbox id="txtcity" cssclass="orderdata" runat="server" width="100"                                 text='<%# bind("city") %>' />                         </td>                         <td>                             <asp:textbox id="txtstate" cssclass="orderdata" runat="server" width="30"                                  text='<%# bind("state") %>' />                         </td>                         <td>                             <asp:textbox id="txtzip" cssclass="orderdata" runat="server" width="50"                                  text='<%# bind("zip") %>' />                         </td>                     </tr>                 </table>             </td>         </tr>         <tr>             <td class="orderheader">                 borrower primary             </td>             <td>                 <asp:textbox id="txtbphone" cssclass="orderdata" runat="server"                      text='<%# bind("phone1", "{0:(###) ###-####}")%>' />             </td>         </tr>         <tr>             <td class="orderheader">                 borrower secondary             </td>             <td>                 <asp:textbox id="txtbcell" cssclass="orderdata" runat="server"                      text='<%# bind("phone2", "{0:(###) ###-####}")%>' />             </td>         </tr>     </table> </edititemtemplate> </asp:formview> <asp:sqldatasource id="sqlloandetails" runat="server"      connectionstring="<%$ connectionstrings:jade_4 %>"      selectcommand="select @orderid orderid, * dbo.getloandata(@orderid)"     updatecommand="select @orderid">     <selectparameters>         <asp:controlparameter controlid="hdnorderid" name="orderid"              propertyname="value" defaultvalue="0" />     </selectparameters>           </asp:sqldatasource> 

vb.net:

protected sub fvloandetails_itemupdating(byval sender object, byval e system.web.ui.webcontrols.formviewupdateeventargs) handles fvloandetails.itemupdating      dim o order = dal.getorderbyid(hdnorderid.value)     dim l loan = dal.getloanbyloanid(o.loanid)     dim b contact = dal.getcontactbyid(l.borrowercontactid)      l.businesschannel = e.newvalues("businesschannel")     l.loantype = e.newvalues("loantype")     l.purpose = e.newvalues("purpose")     l.salesprice = e.newvalues("salesprice")     dal.updateloan(l)      b.firstname = e.newvalues("firstname")     b.lastname = e.newvalues("lastname")     b.address = e.newvalues("address")     b.city = e.newvalues("city")     b.state = e.newvalues("state")     b.zip = e.newvalues("zip")     b.phone = e.newvalues("phone1")     b.cell = e.newvalues("phone2")     dal.updatecontact(b)  end sub 

sql:

    select  l.loannumber, l.businesschannel, l.loantype, l.purpose, l.salesprice, b.firstname, b.lastname, b.email,  b.address, b.city, b.state, b.zip, b.phone phone1, b.cell phone2, dbo.formataddressweb(b.address, '', b.city, b.state, b.zip) mailingaddress          loans l  join orders o on o.orderid=@orderid join contacts b on l.borrowercontactid=b.contactid l.loanid=(select loanid orders orderid=@orderid) 

have tried different format string?

text='<%# bind("salesprice", "{0:c}") %>' 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -