I graduated from the university so far more than a year, the work encountered a lot of problems, thanks to the blog Park Brothers and sisters selfless sharing, thank you!
The following may have errors and omissions, please give us a lot of advice.
C # Background code is as follows:
//method of calling stored procedure
public static void Startupworkflow (String firstnodename, String secondnodename, String firstact)
{
SqlConnection conn = new SqlConnection (configurationsettings.appsettings["diconnectionstring "]);
Conn. Open ();
SqlCommand COMM = conn. CreateCommand ();
//startupworkflow is the name of the stored procedure in SQL
Comm.commandtext = "Startupworkflow";
Comm.commandtype = CommandType.StoredProcedure;
//stored procedure parameters
SP = Comm. Parameters.Add ("Firstnodename", SqlDbType.VarChar, 50);
sp. Value = Firstnodename;
SP = Comm. Parameters.Add ("Secondnodename", SqlDbType.VarChar, 50);
sp. Value = Secondnodename;
SP = Comm. Parameters.Add ("Firstactname", SqlDbType.VarChar, 50);
sp. Value = Firstact;
Comm. ExecuteNonQuery ();
}
The SQL statements are as follows:
ALTER PROCEDURE startupworkflow (@FirstNodeName varchar, @SecondNodeName varchar, @FirstActName varchar (50))
As
--do something
This way you can call the stored procedure in the background.
Calling stored procedures in C # (chapter III)