How to configure IIS not to listen all IP addresses

Sometimes you may want to configure IIS not to listen all IP addresses. To do this:

Run regedit. Go to:

HKLM\System\CurrentControlSet\Services\HTTP\Parameters

If the “ListenOnlyList” key does not exists, create a new multi-string value named “ListenOnlyList” (without quotes). Double click on it, and enter the IP addresses that you want to ISS to listen.

After that, run cmd. Run these commands:

net stop http (Y)
net start http
iisreset

That’s it.

How to get inserted record ID and insert it to foreign key table in SQL?

Here is the sample code:

CREATE PROCEDURE [dbo].[AddRecord]
@Param1 int,
@Param2 varchar(50)

AS
BEGIN
— SET NOCOUNT ON added to prevent extra result sets from
— interfering with SELECT statements.
SET NOCOUNT ON;

DECLARE @InsertedID as int

INSERT INTO PKTable ( Column1, Column2 )
VALUES ( @Param1, @Param2 )

SELECT @InsertedID = @@IDENTITY

INSERT INTO FKTable ( ForeignKeyID )
VALUES ( @InsertedID )
END