My page load event looks like this....
SqlDataSource1.ConnectionString = Connection.ConnectionStr;
SqlDataSource1.SelectCommand = "select firstname,lastname from customer";
SqlDataSource1.InsertCommand = "CustRec_iu";
SqlDataSource1.InsertCommandType = SqlDataSourceCommandType.StoredProcedure;
SqlDataSource1.InsertParameters.Clear();
SqlDataSource1.InsertParameters.Add(new Parameter("firstname", DbType.String));
SqlDataSource1.InsertParameters.Add(new Parameter("LastName", DbType.String));
SqlDataSource1.InsertParameters.Add(new Parameter("Active",DbType.Int16,"1"));
The detailview control setting looks like this....
<asp:DetailsView ID="dvCustDetails1" runat="server" AutoGenerateRows="False"
DataSourceID="SqlDataSource1" Height="149px" Width="469px"
OnItemInserted=dvCustDetails1_ItemInserted
>
<Fields>
<asp:BoundField DataField="FirstName" HeaderText="First Name"
SortExpression="FirstName" />
<asp:BoundField DataField="LastName" HeaderText="Last Name"
SortExpression="LastName" />
<asp:CommandField ButtonType="Button" ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
Right after insert functionality is done, I would like to capture the custid from customer table which is identity column, some how extract it and select table with that record like
select * from customer where custid = @custid.
Then after the control renders after insert, I would like it to show the newly inserted record based on the above select statement.
Also, I would like detailsview to show update button so I could update the record.
How would i accomplish that??
I find very little documentation out there in google search or even print books.