Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Default value for insert parameter

Posted on 2006-03-29
Medium Priority
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

Author Comment

ID: 16320822
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

by:Jason Scolaro
ID: 16322371
Hi JonoBB,

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

To do so, post a zero-point question in http://www.experts-exchange.com/Community_Support/

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

Thank you!

-- Jason

Accepted Solution

GranMod earned 0 total points
ID: 16353471
Closed, 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

580 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