Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6212253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:28:58+00:00 2026-05-24T06:28:58+00:00

I have an SqlDataSource attached to a FormView which is used for inserting/updating, which

  • 0

I have an SqlDataSource attached to a FormView which is used for inserting/updating, which used to work perfectlly – but now all of a sudden, none of the parameters are inserted into the row (the row is still created with error, but all the fields except ID are null). I have double checked to make sure all correct textbox’s are bound to the column name and they are.

I’m just wondering what sort of problems can cause this as I’m stumped. I’ve attached to the DataBound method of the formview just to make sure the form isn’t being rebound on postback and it isn’t. I’ve also checked out the Inserting method and the parameters are all null there.

EDIT: Here’s the datasource markup:

<asp:SqlDataSource runat='server' ID='dsOrders' ConnectionString="<%$ ConnectionStrings:WebConnectionString %>"
                    SelectCommand="SELECT Orders.ID, Orders.Created, Orders.ReportingCat, Orders.OrderType, Orders.Customer, Orders.Reference, Orders.RequiredDate, Contacts.ContactName AS 'ContactName', ISNULL(Orders.Collection, 0) AS 'Collection', Orders.DirectToSite, Orders.OnSite, Orders.DelAdd1, Orders.DelAdd2, Orders.DelAdd3, Orders.DelTown, Orders.DelCounty, Orders.DelPostCode, Orders.Carriage, Orders.CarriageAmount, Orders.CarriageOverrideNote, Orders.SalesPerson, Orders.Offload, Orders.DelTimeBegin, Orders.DelTimeEnd, Orders.DeliveryInstruction, Orders.SpecialInstruction, Orders.AccountsNote, Orders.Status, SalesPeople.FirstName + ' ' + CASE WHEN SalesPeople.Surname IS NULL THEN '' ELSE SalesPeople.Surname END AS SalesName, ISNULL(Orders.ContactID, '') AS ContactID, Orders.OrderNumber, Orders.QuoteNumber, Orders.CustomerOrderLink, ISNULL(Orders.ProjectDetails, 0) AS 'ProjectDetails', Orders.SalesPersonContact, Orders.DeliveryCharge, Orders.SiteName, Orders.MainContractor, Orders.Address, Orders.Town, Orders.County, Orders.Postcode FROM Orders LEFT OUTER JOIN SalesPeople ON Orders.SalesPerson = SalesPeople.ID LEFT OUTER JOIN Contacts ON Orders.ContactID = Contacts.ContactID WHERE (Orders.ID = @Order ) OR ( @Order IS NULL)"
                    InsertCommand="INSERT INTO Orders(Customer, Collection, SalesPerson, Offload, Status, ContactID, OrderNumber, QuoteNumber, ProjectDetails, SalesPersonContact, DeliveryCharge) VALUES (@Customer, @Collection, @SalesPerson, @Offload, 1, @ContactID, @OrderNumber, @QuoteNumber, @ProjectDetails, @SalesPersonContact, @DeliveryCharge); SET @ReturnID = SCOPE_IDENTITY();"
                    OnInserted="dsOrders_Inserted" OnInserting="dsOrders_Inserting" UpdateCommand="UPDATE Orders SET Customer = @Customer, Collection = @Collection, SalesPerson = @SalesPerson, Offload = @Offload, ContactID = @ContactID, OrderNumber = @OrderNumber, QuoteNumber = @QuoteNumber, ProjectDetails = @ProjectDetails, SalesPersonContact = @SalesPersonContact, DeliveryCharge = @DeliveryCharge WHERE (ID = @ID)">
                    <UpdateParameters>
                        <asp:Parameter Name="Customer" Type="String" />
                        <asp:Parameter Name="Collection" Type="Boolean" />
                        <asp:Parameter Name="SalesPerson" Type="Int32" />
                        <asp:Parameter Name="Offload" Type="Boolean" />
                        <asp:Parameter Name="ContactID" Type="Int64" />
                        <asp:Parameter Name="OrderNumber" Type="Int64" />
                        <asp:Parameter Name="QuoteNumber" Type="String" />
                        <asp:Parameter Name="ProjectDetails" Type="Boolean" />
                        <asp:Parameter Name="SalesPersonContact" Type="Int64" />
                        <asp:Parameter Name="DeliveryCharge" Type="Int32" />
                        <asp:SessionParameter Name="ID" SessionField="OrderID" Type="Int64" />  
                    </UpdateParameters>
                    <InsertParameters>
 <asp:Parameter Name="Customer" Type="String" />
                        <asp:Parameter Name="Collection" Type="Boolean" />
                        <asp:Parameter Name="SalesPerson" Type="Int32" />
                        <asp:Parameter Name="Offload" Type="Boolean" />
                        <asp:Parameter Name="ContactID" Type="Int64" />
                        <asp:Parameter Name="OrderNumber" Type="Int64" />
                        <asp:Parameter Name="QuoteNumber" Type="String" />
                        <asp:Parameter Name="ProjectDetails" Type="Boolean" />
                        <asp:Parameter Name="SalesPersonContact" Type="Int64" />
                        <asp:Parameter Name="DeliveryCharge" Type="Int32" />
                        <asp:Parameter Name="ReturnID" Direction="Output" Type="Int64" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:SessionParameter DefaultValue="null" Name="Order" SessionField="OrderID" />
                    </SelectParameters>
                </asp:SqlDataSource>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:29:01+00:00Added an answer on May 24, 2026 at 6:29 am

    In your INSERT command I cannot see ID:

    INSERT INTO Orders(Customer, Collection, SalesPerson, Offload, Status, ContactID,
    OrderNumber, QuoteNumber, ProjectDetails, SalesPersonContact, DeliveryCharge) VALUES
    (@Customer, @Collection, @SalesPerson, @Offload, 1, @ContactID, @OrderNumber, @QuoteNumber, 
    @ProjectDetails, @SalesPersonContact, @DeliveryCharge);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQLDataSource that is bound to a ListView control but I want
i am using formview and sqldatasouce. every thing is fine but when i have
I have an asp.net application in which I am inserting into an sql table
I have ALWAYS used the SQLDataSource to update my records in my SQL Server
I have an sqldatasource that takes a stored procedure with a parameter..But that the
I have an SqlDataSource in a page, which will display different results depending on
I have a GridView and a SqlDataSource, which I have set to automatically generate
I have a FormView bound to a SqlDataSource on my page. One of the
I have a GridView bound to a SqlDataSource. I'm pulling hyperlinks which point to
I currently have a dropdownlist which is populated via an SQLDataSource from the Module

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.