dik mus
|
Posted: 01/12/2005, 5:51 AM |
|
Hi,
In my project application, if a new project is created, i need to automatic add some records in another table (milestones).
I thought of creating a stored procedure (like a append query) that is called when the user clicks the save project button.
Is this the way, and if so, How can i call a stored procedure in code?
Thanks, dik
|
|
|
peterr
Posts: 5971
|
Posted: 01/12/2005, 12:00 PM |
|
Take a look at http://www.google.com/search?hl=en&q=.net+calling+stored+procedures
A better idea may be to use database triggers as this is their main purpose.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
dik mus
|
Posted: 01/12/2005, 1:13 PM |
|
Thanks Peter,
I think i can make the trigger, but is there a simple way to start that
trigger from css.
In the google search you refer to, i can only find quite a bit of code to
build a connection and dataadapter first.
I hoped css had something build in to make things easyer. or am I getting
too layzy using css? : )
Or could you perhaps refer to a CSS example?
"peterr" <peterr@forum.codecharge> schreef in bericht
news:841e581ee82039@news.codecharge.com...
> Take a look at
> http://www.google.com/search?hl=en&q=.net+calling+stored+procedures
>
> A better idea may be to use database triggers as this is their main
> purpose.
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
E43509
Posts: 283
|
Posted: 01/19/2005, 10:42 AM |
|
I'm not sure what db you are using but this is a snippet from one of my projects to call a stored procedure on a button trigger.
Dim myConn As OracleClient.OracleConnection
Dim myCmd As OracleClient.OracleCommand
Dim myParam as OracleClient.OracleParameter
myConn = New OracleClient.OracleConnection(System.Configuration.ConfigurationSettings.AppSettings("cnTMSString"))
myCmd = New OracleClient.OracleCommand("examprocs.lock_n_grade", myConn)
myCmd.CommandType = CommandType.StoredProcedure
myCmd.Parameters.Add(New OracleClient.OracleParameter("in_test_pk", OracleClient.OracleType.Int32)).Value = System.Web.HttpContext.Current.Session("student_test_pk")
myConn.Open()
myCmd.ExecuteNonQuery()
myConn.Close()
|
|
|
|