I can add a record but the update or delete won't work. I suspect it can't find the "ID" field. SOWHelpScreenContactsDataUniqueID
I did not have an ID field when I tested the Update originally and it updated both records with the same data. so I added a Where but now it updates nothing. I am using the Wizard screen to do this by clicking the arrow on the listview.
There are no errors and it reverts back to the record as though it was not edited and the deleted record is still there after the pages refreshes?
So what am I missing?
I did not post the top part of teh code since it 100 lines so if you want to see something specific let me know so I can post it.
TIA
DougP
I did not have an ID field when I tested the Update originally and it updated both records with the same data. so I added a Where but now it updates nothing. I am using the Wizard screen to do this by clicking the arrow on the listview.
There are no errors and it reverts back to the record as though it was not edited and the deleted record is still there after the pages refreshes?
So what am I missing?
I did not post the top part of teh code since it 100 lines so if you want to see something specific let me know so I can post it.
TIA
Code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:SOWTimeReportingConnectionString %>"
DeleteCommand="DELETE FROM SOWHelpScreenContactsData WHERE (SOWHelpScreenContactsDataUniqueID = @SOWHelpScreenContactsDataUniqueID)"
InsertCommand="INSERT INTO SOWHelpScreenContactsData(FirstName, LastName, Phone, Email, Organization) VALUES (@FirstName, @LastName, @Phone, @email, @Organization)"
SelectCommand="SELECT Organization, FirstName, LastName, Phone, Email, SOWHelpScreenContactsDataUniqueID FROM SOWHelpScreenContactsData"
UpdateCommand="UPDATE SOWHelpScreenContactsData SET FirstName = @FirstName, LastName = @LastName, Phone = @Phone, Email = @Email, URL = @URL, VPPOC = @VPPOC, Organization = @Organization WHERE (SOWHelpScreenContactsDataUniqueID = @SOWHelpScreenContactsDataUniqueID )">
<DeleteParameters>
<asp:Parameter Name="SOWHelpScreenContactsDataUniqueID" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="FirstName" />
<asp:Parameter Name="LastName" />
<asp:Parameter Name="Phone" />
<asp:Parameter Name="email" />
<asp:Parameter Name="Organization" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="FirstName" />
<asp:Parameter Name="LastName" />
<asp:Parameter Name="Phone" />
<asp:Parameter Name="Email" />
<asp:Parameter Name="URL" />
<asp:Parameter Name="VPPOC" />
<asp:Parameter Name="Organization" />
<asp:Parameter Name="SOWHelpScreenContactsDataUniqueID" />
</UpdateParameters>
</asp:SqlDataSource>
DougP