Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp 4 VB listview can't update or delete a record

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
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
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top