J
Jim in Arizona
I'm making an app that inputs into multiple tables. I'm using the
SCOPE_IDENTITY() SQL function for foreign key purposes. I input into the
main table first and retrieve the scope_identity() and then insert into
related tables using the scope_identity() number as the foregin key entry
for each table.
Each of these inputs is done within the code for seperate buttons. How do I
create a variable (a string type) I can use throughout the application? I'd
populate it with the scope_identity() and would want that number to remain
in that variable until I manually clear it out.
I tried this at the top of the page (code file) before any other
subroutines.
Partial Class inventory_index
Inherits System.Web.UI.Page
Public strScopeID As String
But if I try a response.write(strScopeID) after I populate it (at least I
think I do), I get the error:
Object reference not set to an instance of an object.
TIA,
Jim
SCOPE_IDENTITY() SQL function for foreign key purposes. I input into the
main table first and retrieve the scope_identity() and then insert into
related tables using the scope_identity() number as the foregin key entry
for each table.
Each of these inputs is done within the code for seperate buttons. How do I
create a variable (a string type) I can use throughout the application? I'd
populate it with the scope_identity() and would want that number to remain
in that variable until I manually clear it out.
I tried this at the top of the page (code file) before any other
subroutines.
Partial Class inventory_index
Inherits System.Web.UI.Page
Public strScopeID As String
But if I try a response.write(strScopeID) after I populate it (at least I
think I do), I get the error:
Object reference not set to an instance of an object.
TIA,
Jim