Solved

formview updateitem not updating !?

Posted on 2011-09-12
4
984 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now