SQL database Connection statement

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.