1
11D.Universe
I'm using the Insert button in a DetailsView to insert a record into a
SQL table. I've got part of what I need to recover the record ID...
The INSERT COMMAND is:
InsertCommand="INSERT INTO [inventory] ([Active], ...) VALUES
(@Active...); select SCOPE_IDENTITY();"
The Select Command is:
SelectCommand="SELECT * FROM [inventory] where [inventoryID] =
@identity ORDER BY [InventoryID] DESC"
The Insert Parameters are:
<InsertParameters>
<asp
arameter Name="Active" Type="Boolean" />
...
<asp:QueryStringParameter Name="@identity"
Direction="Output" Type="Int32" />
</InsertParameters>
The Select Parameters are:
<asp
arameter Name="identity" Type="Int32" />
I know I'm supposed to put some code in the SqlDataSource1_Inserted
sub, but not sure what code is needed to get the InventoryID from the
inserted record.
Am I on the right track??
Any help would be appreciated...
SQL table. I've got part of what I need to recover the record ID...
The INSERT COMMAND is:
InsertCommand="INSERT INTO [inventory] ([Active], ...) VALUES
(@Active...); select SCOPE_IDENTITY();"
The Select Command is:
SelectCommand="SELECT * FROM [inventory] where [inventoryID] =
@identity ORDER BY [InventoryID] DESC"
The Insert Parameters are:
<InsertParameters>
<asp
...
<asp:QueryStringParameter Name="@identity"
Direction="Output" Type="Int32" />
</InsertParameters>
The Select Parameters are:
<asp
I know I'm supposed to put some code in the SqlDataSource1_Inserted
sub, but not sure what code is needed to get the InventoryID from the
inserted record.
Am I on the right track??
Any help would be appreciated...