Solved

formview updateitem not updating !?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

914 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

13 Experts available now in Live!

Get 1:1 Help Now