title: Pass SQL function value to ASP form
body: <p>I created A function as below in SQL server ,i want to get the max ID then pass it to the ASP form in IDtextbox
  how shall i do that ? "if there any problem with the Function please fix it and advice about C# code"
  if i had another procedure do different thing , can i execute it with the function at the same time with same connection ?</p>
  
  <pre><code>Alter FUNCTION [dbo].[FN_Justification_MaxGroupID] ()
      RETURNS INT
  AS
  
  BEGIN
  
      Declare @MaxGroupID int
  
      SELECT  @MaxGroupID = Max([Justification_Group_ID]) +1 from [dbo].[TBL_Justification]
  
      RETURN  @MaxGroupID;
  
  end
  
  go
  
  Declare @ID int
  
  Select @ID= [dbo].[FN_Justification_MaxGroupID] ()
  
  Select @ID
  </code></pre>