设为首页 - 加入收藏  
您的当前位置:首页 >IT科技类资讯 >SubSonic直接执行SQL语句的方法 正文

SubSonic直接执行SQL语句的方法

来源:汇智坊编辑:IT科技类资讯时间:2025-11-04 12:58:25
SubSonic直接执行SQL语句的方法
复制01 public void Inline_Simple()     02 {     03     QueryCommand cmd = new InlineQuery().GetCommand("SELECT productID from products");     04     Assert.IsTrue(cmd.CommandSql ==      05             "SELECT productID from products");     06 }     07      08 public void Inline_WithCommands()     09 {     10     QueryCommand cmd = new InlineQuery()     11            .GetCommand(@"SELECT productID from products      12                WHERE productid=@productid",直接执行 1);     13      14     Assert.IsTrue(cmd.Parameters[0].ParameterName == "@productid");     15     Assert.IsTrue((int)cmd.Parameters[0].ParameterValue == 1);     16 }     17      18 public void Inline_AsCollection()     19 {     20     ProductCollection products =     21         new InlineQuery()     22             .ExecuteAsCollection<ProductCollection>(     23                       @"SELECT productID from products      24                        WHERE productid=@productid", 1);     25 }    1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.

0.2349s , 17455.09375 kb

Copyright © 2025 Powered by SubSonic直接执行SQL语句的方法,汇智坊  滇ICP备2023006006号-2

sitemap

Top