Default value for insert parameter
Posted on 2006-03-29
I have two detailsview on a single page, DetailsView1 and DetailsView2.
DetailsView1 is based on a recordset as follows:
DetailsView2 is based on a recordset as follows:
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.