|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrieving the value of the identity field of a newly inserted record?In ASP.NET 2.0 and the formview control how do you get the value of the
identity field of a newly inserted record? In ASP.NET 1.1 after the new record was saved you just said intNewIdentityID = Dataset.tblMtTable.IndentityID Simple but can't seem to do it in the formview. Thanks You need to create an event handler for the DataSource Control that the
FormView Control is bound to. In the Properties for the DataSource Control, view the Events (Lightning Bolt) and double click on the "Inserted" event. This will create the handler. This event is raised when a record is inserted. Within the handler add... int Id = e.Command.Parameters["@WhatYouNamedReturnParam"].Value This will grab the Id value of the inserted record as long as you set it up in the stored procedure. Show quoteHide quote "Craig" wrote: > In ASP.NET 2.0 and the formview control how do you get the value of the > identity field of a newly inserted record? > > In ASP.NET 1.1 after the new record was saved you just said > intNewIdentityID = Dataset.tblMtTable.IndentityID > Simple but can't seem to do it in the formview. > > > > Thanks > > >
Any hints on how to do frames in ASP.Net 2.0?
Code to select item in dropdown populated using TableAdapter Referencing controls inside Wizard control Custom Treenodes in Treeview Would like to get two items from a dropdownlist Problem in Setting SelectedValue for DropdownList in Form DropDownList VS TextBox CheckBoxList - When does it actually databind? add dynamically multiple controls into one panel controlToValidate property of compareValidator |
|||||||||||||||||||||||