Default value for insert parameter

Posted on 2006-03-29
Last Modified: 2008-01-09

I have two detailsview on a single page, DetailsView1 and DetailsView2.

DetailsView1 is based on a recordset as follows:

ApplicantID (PK)

DetailsView2 is based on a recordset as follows:

ApplicationNoteID (PK)
ApplicantID (FK from tblApplication)

Now, I would like to insert a new record into tblAppllicationNote using DetailsView2, and I have assigned the parameters as follows:
                <asp:Parameter Name="ApplicantID" Type="Int32" DefaultValue="2" />
                <asp:Parameter Name="NoteDetails" Type="String" />
                <asp:Parameter Name="NoteDate" Type="DateTime" />

As you can see, I have assigned a default value of "2" for ApplicantID to test that the insert command works, which it does.

However, I would like to set the default value of ApplicantID to be the currentvalue of DetailsView1; i.e. as we page through the recordset in DetailsView1, then inserting a note in DetailsView2 will happen correctly.

Thanks for any help that you can provide.
Question by:JonoBB
    LVL 8

    Author Comment

    I seem to be answering these faster than anyone else...

                    <asp:Parameter Name="ApplicantID" Type="Int32" DefaultValue="2" />


                    <asp:ControlParameter ControlID="FormView1" Name="ApplicantID" PropertyName="SelectedValue"
                        Type="Int32" />
    LVL 22

    Expert Comment

    Hi JonoBB,

    Please, when you get a chance, close this question.  

    To do so, post a zero-point question in

    Subject: Moderator Please PAQ
    Body: Please PAQ this question, I answered it myself

    Thank you!

    -- Jason

    Accepted Solution

    Closed, 500 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    733 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

    21 Experts available now in Live!

    Get 1:1 Help Now