The general remote access is written like this:
Data source=ip; Initial catalog= database name; userid= user name; password= Password
Local access is written like this:
Data source= (local); Initial catalog= database name; userid= user name; password= Password
If it is local, it is written by the Windows component (that is, no user name, password):
Data source= (local); Initial catalog= database name; Integrated security=true
If it is not the default instance, if the instance name is SQLExpress, write this:
Data source= (local)/sqlexpress; Initial catalog= database name; Integrated security=true
ExecuteReader Simple and efficient, single-forward data query. Returns a SqlDataReader object Typically used to read data
ExecuteNonQuery Returns a value of type int that returns the number of rows affected in the database. Various operations for the database
ExecuteScalar Returns the first column of the first row of the read result |
workflowidled Events. NET Framework Class Library WorkflowRuntime. . :: . workflowidled Events
Updated: November 2007
Occurs after a workflow instance enters an idle state
static void Main ()
{
String connectionString = "Initial catalog=sqlpersistenceservice;data source=localhost;integrated security=sspi;";
using (WorkflowRuntime workflowruntime = new WorkflowRuntime ())
{
ExternalDataExchangeService DataService = new ExternalDataExchangeService ();
Workflowruntime.addservice (DataService);
Dataservice.addservice (Expenseservice);
Workflowruntime.addservice (New SqlWorkflowPersistenceService (connectionString));
Workflowruntime.startruntime ();
workflowruntime.workflowcompleted + = onworkflowcompleted;
workflowruntime.workflowterminated + = onworkflowterminated;
workflowruntime.workflowidled + = onworkflowidled;
workflowruntime.workflowaborted + = onworkflowaborted;
Type type = typeof (SampleWorkflow1);
WorkflowInstance workflowinstance = Workflowruntime.createworkflow (type);
Workflowinstance.start ();
WaitHandle.WaitOne ();
Workflowruntime.stopruntime ();
}
}
SQL database Connection statement