Sign up ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free.

I have a SqlDataSource which helps a Listview to Insert/Delete new data. But, I don't want to show the existing data to the Listview using this SqlDataSource. Only the newly inserted records to be shown. But, this shows everything on the Listview. If I remove the SelectCommand, Even the newly inserted rows won't be shown.

  <asp:SqlDataSource ID="VendorSOAPaymentsInnerDS" runat="server"
      ConnectionString="<%$ ConnectionStrings:ApplicationServices %>" 
      InsertCommand = "INSERT INTO VendorSOAPayments ( VendorSOAID, PaymentVoucherID, PaymentAmount) VALUES( @VendorSOAID, @PaymentVoucherID, @PaymentAmount)"  
      SelectCommand= "SELECT A.VendorSOAPaymentID, A.PaymentVoucherID, B.SubProjectID, B.StatementBreakDown, A.PaymentAmount, C.SubProjectCode, C.SubProjectName FROM  VendorSOAPayments A INNER JOIN VendorSOA B ON A.VendorSOAID = B.VendorSOAID INNER JOIN SubProject C ON B.SubProjectID = C.SubProjectID WHERE A.PaymentVoucherID  = @PaymentVoucherID  AND B.Vendor_EntityID = @VendorID "
     DeleteCommand = "DELETE VendorSOAPayments WHERE VendorSOAPaymentID = @VendorSOAPaymentID" >
     <SelectParameters>
          <asp:ControlParameter ControlID="ListPayVoucherID" Name="PaymentVoucherID" PropertyName="Value" />
          <asp:ControlParameter ControlID="vendorSelectID" Name="VendorID" PropertyName="Value" /> 
      </SelectParameters>
      <InsertParameters>
          <asp:Parameter Name="VendorSOAID" />
          <asp:Parameter Name="PaymentAmount" />
          <asp:ControlParameter ControlID="ListPayVoucherID" Name="PaymentVoucherID" PropertyName="Value" />
       </InsertParameters>
  </asp:SqlDataSource>
share|improve this question

1 Answer 1

You can add inserted records to a datatable and save the datatable to a session.

share|improve this answer
    
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. –  Nico Jun 3 at 1:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.