码迷,mamicode.com
首页 > 数据库 > 详细

SQL数据库连接语句

时间:2017-07-22 18:12:11      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:取数   pru   time   framework   进入   target   lib   cal   art   

一般的远程访问的写成这样:

Data Source=IP ;Initial Catalog=数据库名 ;UserID= 用户名 ;Password=密码

本地访问的写成这样:

Data Source=(local);Initial Catalog=数据库名 ;UserID= 用户名 ;Password=密码

如果是本地的,通过windows组件验证的(也就是没有用户名,密码的)写成这样:

Data Source=(local);Initial Catalog=数据库名 ;Integrated Security=True

如果不是默认的实例,假如实例名是SQLEXPRESS,写成这样:

Data Source=(local)/SQLEXPRESS ;Initial Catalog=数据库名 ;Integrated Security=True

 

 

ExecuteReader 
简单高效的,单向前的数据查询。返回一个SqlDataReader对象 
通常用于读取数据 

ExecuteNonQuery 
返回一个int类型的值,返回数据库中所影响的行数。 
用于对数据库的各种操作

ExecuteScalar 
返回读出结果的第一行第一列

 

 WorkflowIdled 事件
 
.NET Framework 类库
WorkflowRuntime:: . WorkflowIdled 事件

 

更新:2007 年 11 月

在工作流实例进入空闲状态后发生

 

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数据库连接语句

标签:取数   pru   time   framework   进入   target   lib   cal   art   

原文地址:http://www.cnblogs.com/liuhuimh/p/7221710.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!