Solved

formview updateitem not updating !?

Posted on 2011-09-12
4
1,002 Views
Last Modified: 2012-05-12
i tried to do a manual update for a formview in asp.net application , the Sqldatasource that are connected to the Formview is :

  <asp:SqlDataSource ID="OnlineApp" runat="server" ConnectionString="<%$ ConnectionStrings:OnlineAppConnectionString %>"
                        InsertCommand="INSERT INTO [APP_A] ([AppId], [AppSubmitDate], [AppElectSubmit], [AppFaxSubmit], [AppNormalSubmit], [AppPersonalSubmit]) VALUES (@AppId, @AppSubmitDate, @AppElectSubmit, @AppFaxSubmit, @AppNormalSubmit, @AppPersonalSubmit)"
                        SelectCommand="SELECT * FROM [APP_A]"
                        UpdateCommand="UPDATE [APP_A] SET [AppSubmitDate] = @AppSubmitDate, [AppElectSubmit] = @AppElectSubmit, [AppFaxSubmit] = @AppFaxSubmit, [AppNormalSubmit] = @AppNormalSubmit, [AppPersonalSubmit] = @AppPersonalSubmit WHERE [AppId] = @AppId"
                        DeleteCommand="DELETE FROM [APP_A] WHERE [AppId] = @AppId">
                       
                       
                        <DeleteParameters>
                            <asp:Parameter Name="AppId" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:SessionParameter Name="AppId" SessionField="AppId" />
                            <asp:Parameter DbType="Date" Name="AppSubmitDate" />
                            <asp:Parameter Name="AppElectSubmit" Type="Boolean" />
                            <asp:Parameter Name="AppFaxSubmit" Type="Boolean" />
                            <asp:Parameter Name="AppNormalSubmit" Type="Boolean" />
                            <asp:Parameter Name="AppPersonalSubmit" Type="Boolean" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter DbType="Date" Name="AppSubmitDate" />
                            <asp:Parameter Name="AppElectSubmit" Type="Boolean" />
                            <asp:Parameter Name="AppFaxSubmit" Type="Boolean" />
                            <asp:Parameter Name="AppNormalSubmit" Type="Boolean" />
                            <asp:Parameter Name="AppPersonalSubmit" Type="Boolean" />
                            <asp:SessionParameter Name="AppId" SessionField="AppId" />
                        </UpdateParameters>
                    </asp:SqlDataSource>


the part the i use to do the update is:

  Select Case FormView2.CurrentMode
                    Case FormViewMode.Insert
                        FormView2.InsertItem(True)

                    Case FormViewMode.Edit
                        FormView2.UpdateItem(True)
                End Select


the insertitem work fine, but the update do nothing

any advice ?
0
Comment
Question by:nasemabdullaa
  • 2
  • 2
4 Comments
 
LVL 17

Expert Comment

by:sonawanekiran
ID: 36522458
Use profiler to check what update command is firing at back end. Profiler will show you sql command. Check this update statement.
0
 

Author Comment

by:nasemabdullaa
ID: 36523958
can you give me more details about Profiler ? a download link ? is it open source ?
0
 
LVL 17

Accepted Solution

by:
sonawanekiran earned 500 total points
ID: 36527238
It is not a open source. It's sql server tool to monitor queries firing at back end.

http://www.petri.co.il/monitoring-with-sql-profiler.htm

Search with SQL profiler
0
 

Author Closing Comment

by:nasemabdullaa
ID: 36711663
is working now
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question