当前位置: 首页>>代码示例>>C#>>正文


C# SqlExecutor.SetUpDatabase方法代码示例

本文整理汇总了C#中SqlExecutor.SetUpDatabase方法的典型用法代码示例。如果您正苦于以下问题:C# SqlExecutor.SetUpDatabase方法的具体用法?C# SqlExecutor.SetUpDatabase怎么用?C# SqlExecutor.SetUpDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SqlExecutor的用法示例。


在下文中一共展示了SqlExecutor.SetUpDatabase方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BadlyFormedQueriesCauseFailedResult

        public void BadlyFormedQueriesCauseFailedResult()
        {
            var application = new SqlExecutor(m_SqlServerConfiguration);
            application.SetUpDatabase(" ");
            var result = application.ExecuteQuery("SELECTEROO");

            Assert.Equal("Could not find stored procedure 'SELECTEROO'.", ExpectError(result));
        }
开发者ID:modulexcite,项目名称:learnsomesql.com,代码行数:8,代码来源:SqlExecutorTests.cs

示例2: EmptyQueriesCauseFailedResult

 public void EmptyQueriesCauseFailedResult()
 {
     var application = new SqlExecutor(m_SqlServerConfiguration);
     application.SetUpDatabase(" ");
     var result = application.ExecuteQuery("");
     
     Assert.Equal("Query is empty", ExpectError(result));
 }
开发者ID:modulexcite,项目名称:learnsomesql.com,代码行数:8,代码来源:SqlExecutorTests.cs

示例3: SetUpRunsCreationSql

        public void SetUpRunsCreationSql()
        {
            var creationSql = @"
                CREATE TABLE JustTesting (
	                Id INT IDENTITY NOT NULL,
	                Answer INT NOT null
                )

                INSERT INTO JustTesting (Answer) VALUES (42)
            ";

            var application = new SqlExecutor(m_SqlServerConfiguration);
            application.SetUpDatabase(creationSql);
            var result = application.ExecuteQuery("SELECT Answer FROM JustTesting").ExpectSuccess();
            Assert.Equal(42, result.Rows[0].ValueAtIndex<int>(0));
        }
开发者ID:modulexcite,项目名称:learnsomesql.com,代码行数:16,代码来源:SqlExecutorTests.cs

示例4: AssertDisplayValue

        private void AssertDisplayValue(string sqlType, string sqlValue, string expectedDisplayValue)
        {
            var creationSqlTemplate = @"
                CREATE TABLE JustTesting (
	                Id INT IDENTITY NOT NULL,
	                Answer {0} NOT null
                )

                INSERT INTO JustTesting (Answer) VALUES ({1})
            ";
            var creationSql = string.Format(creationSqlTemplate, sqlType, sqlValue);

            var application = new SqlExecutor(m_SqlServerConfiguration);
            application.SetUpDatabase(creationSql);
            var result = application.ExecuteQuery("SELECT Answer FROM JustTesting").ExpectSuccess();
            Assert.Equal(expectedDisplayValue, result.Rows[0].DisplayValueAtIndex(0));
        }
开发者ID:modulexcite,项目名称:learnsomesql.com,代码行数:17,代码来源:SqlExecutorTests.cs

示例5: ExecuteSqlOnBlankDatabase

 private QueryResultTable ExecuteSqlOnBlankDatabase(string sql)
 {
     var application = new SqlExecutor(m_SqlServerConfiguration);
     application.SetUpDatabase(" ");
     return application.ExecuteQuery(sql).ExpectSuccess();
 }
开发者ID:modulexcite,项目名称:learnsomesql.com,代码行数:6,代码来源:SqlExecutorTests.cs


注:本文中的SqlExecutor.SetUpDatabase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。