How to procure IP Address of Symtem ??

  • Hi,

    I have created a user registration form

    in which user have to fill Name,emil id, Phone Number.

    In the back end i have created a table with the columns

    name,email_id,Phone_number,Ip_address.

    on button click event i have written this programming.

    insert into tbl_login values (textbox1.text,textbox2.texttextbox3.text)

    I would like to insert the value for IP address of the system of the user(who is doing registration.)

    Please help me.

  • Assuming the clients are connecting directly to the database, this should do:

    SELECT client_net_address

    FROM sys.dm_exec_connections

    WHERE session_id = @@spid

    If this is a web application or runs on any sort of application server, you'll have to gather the address from the client side of the application.

    -- Gianluca Sartori

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply