SEO Software
Closed Thread
Results 1 to 2 of 2

Thread: How to use trigger with Asp.net

  1. #1

    Default How to use trigger with Asp.net

    I am using asp.net with c# and ms sql server how can I use trigger with it?


  2. Micro Niche Builder

  3. #2

    Default

    Trigger can not be made in asp.net.
    You have to create in ms sql.
    It will be automaticaly call.

    For example :
    Code:
    create trigger del_cuser
    on CurrentUser
    after delete
    As 
    Begin
    	Declare @UserId varchar(4)
    	Declare @Amount varchar(9)
    	Declare @Udate varchar(8)
    	
    	select
    		@UserId=UserId,
    		@Amount=Amount,
    		@Udate=Udate,
    			from DELETED
    		
    
    	insert into PreviousUser values(@UserId,@Amount,@Udate);
    End
    I have created this in ms sql in query analyze.

    In this there are 2 tables.
    Current users & Previous users.

    Using this trigger when i delete a record from current user,this record will automaticaly inserted in Previous user.

Closed Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts