예제 #1
0
        // Get the count of elements in the Roles table using DbQueryScalar
        static void GetRolesCount()
        {
            Activity dbSelectCount = new DbQueryScalar <int>()
            {
                ConfigName = "DbActivitiesSample",
                Sql        = "SELECT COUNT(*) FROM Roles"
            };

            IDictionary <string, object> results = WorkflowInvoker.Invoke(dbSelectCount);

            Console.WriteLine("Result: {0}", results["Result"].ToString());
        }
예제 #2
0
        // Retrieves the current date using a DbQueryScalar
        static void GetCurrentDate()
        {
            Activity dbSelectCount = new DbQueryScalar <DateTime>()
            {
                ProviderName     = providerInvariantName,
                ConnectionString = connectionString,
                Sql = "SELECT GetDate()"
            };

            IDictionary <string, object> results = WorkflowInvoker.Invoke(dbSelectCount);

            Console.WriteLine("Result: {0}", results["Result"].ToString());
        }