Whenever I run the form and complete the procedure then I need to go back to sql database and click on execute. I want to avoid everytime going back and executing each entry because if I don't execute everytime then the further other [b]form data [/b]will
not be[b] retrieved[/b] properly as the [b]previous form[/b] will [b]not be updated[/b]. I hope ur understanding ...
I have written the query in the [b]form code[/b] itself.
I have used [b]trigger[/b] once but that was on the Database side itself.
so,this time I am not understanding what to do!!
So what is the solution to make the database execute automatically once the code is being executed i.e. the details are sent to database?
You can create a Stored Procedure and put in whatever logic you need to perform on your Data, now you can call this stored procedure from asp.net code.
IAmateur
Member
96 Points
388 Posts
Trigger
Apr 26, 2012 10:14 AM|LINK
Whenever I run the form and complete the procedure then I need to go back to sql database and click on execute. I want to avoid everytime going back and executing each entry because if I don't execute everytime then the further other [b]form data [/b]will not be[b] retrieved[/b] properly as the [b]previous form[/b] will [b]not be updated[/b]. I hope ur understanding ...
I have written the query in the [b]form code[/b] itself.
I have used [b]trigger[/b] once but that was on the Database side itself.
so,this time I am not understanding what to do!!
So what is the solution to make the database execute automatically once the code is being executed i.e. the details are sent to database?
Time to go Long way...
nijhawan.sau...
All-Star
16460 Points
3178 Posts
Re: Trigger
Apr 26, 2012 10:23 AM|LINK
You can create a Stored Procedure and put in whatever logic you need to perform on your Data, now you can call this stored procedure from asp.net code.
IAmateur
Member
96 Points
388 Posts
Re: Trigger
Apr 26, 2012 02:46 PM|LINK
nijhawan.saurabh
I don't know how to do this...So I asked here.
Time to go Long way...
IAmateur
Member
96 Points
388 Posts
Re: Trigger
Apr 27, 2012 03:15 AM|LINK
nijhawan.saurabh
did u mean to remove the query command code of form side and put it in stored procedure and then call this stored procedure from form side?
Time to go Long way...
nijhawan.sau...
All-Star
16460 Points
3178 Posts
Re: Trigger
Apr 27, 2012 06:37 AM|LINK
Correct!
IAmateur
Member
96 Points
388 Posts
Re: Trigger
Apr 27, 2012 08:13 AM|LINK
What is the syntax to cal stored procedure from code side?
Time to go Long way...
kelviyean
Member
228 Points
54 Posts
Re: Trigger
Apr 27, 2012 08:19 AM|LINK
Hello,
Follow the thread below. It will help you
http://support.microsoft.com/kb/306574
Chen Yu - MS...
All-Star
21829 Points
2513 Posts
Microsoft
Re: Trigger
May 02, 2012 08:43 AM|LINK
Hi,
You could write like this:
SqlConnection conn = new SqlConnection("your_sql_server_connection_string"); SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "your sp's name"; //add values to paramters. cmd.Parameters.AddWithValue("@name1", "name1"); conn.Open(); cmd.Connection = conn; cmd.ExecuteNonQuery(); conn.Close();Thanks.
Feedback to us
Develop and promote your apps in Windows Store