want some idea
-
i am newbie to asp.net. Currently i using making web application using C# and aSP.NET(VISUAL STUDIO 2005).i am making web page to track Inquiry coming for services. I want to make inquiry id as combination of serviceid and maximum no in the respective service so i am trying when user select respective service. i would populate 1 + of max no. of respective service.Where do i write code for same. Is it possible as after selecting service id i am generating query. Please guide me.
regards imran khan
-
i am newbie to asp.net. Currently i using making web application using C# and aSP.NET(VISUAL STUDIO 2005).i am making web page to track Inquiry coming for services. I want to make inquiry id as combination of serviceid and maximum no in the respective service so i am trying when user select respective service. i would populate 1 + of max no. of respective service.Where do i write code for same. Is it possible as after selecting service id i am generating query. Please guide me.
regards imran khan
HI Imran, YOu can generate the respective service id at database level.If you are using database table then simply declare a variable and then select max id and increase by 1.See the example below - DECLARE @intMAXID INTEGER SET NOCOUNT ON --Get the Maximum ID from the Table and increment it by 1 SELECT @intMaxID = MAX([ContactId])+1 FROM TESTTABLE IF @intMaxID is NULL select @intMaxID = 1 I hope this is helpful for you as i understand the problem .If you want another then please let me know.
Vicky