Hi all,
I'm new to ASP.net and and using Visual Studio 2008 and VB as my source code. I would like to query a database for a value (guaranteed to return 1 row 1 column (SELECT MAX(RECIPE_ID FROM TB_RECIPE) and then insert this value as part of another insert statement (INSERT INTO [TB_INGREDIENTS] ([RECIPE_ID], [OWNER_ID], [INGREDIENT_NAME], [QUANTITY], [UNIT_OF_MEASURE]) VALUES (@RecipeID, @UserID, @INGREDIENT_NAME, @QUANTITY, @UNIT_OF_MEASURE)) where the Recipe ID obtained in the first query is the parameter sent in the insert statement as @RecipeID.
I'm using SQL Server 2005 Express connecting to an attached .mdf file.
I think based on my research so far on this site that I need to use a scalar variable, but I'm too new to this to know how to accomplish this. Any help would be greatly appreciated....