.Net Core与存储过程(一)

例子1 C# 调用存储过程

sql 复制代码
CREATE PROCEDURE [dbo].[spFunc]
@id BIGINT, @isTrue BIT, @str NVARCHAR (60), @strZh NVARCHAR (60)
AS
BEGIN
    SELECT *
    FROM   tableA
    WHERE  id = @id
           AND isTrue = @isTrue
           AND str = @str
           AND strZh = @strZh;
END
csharp 复制代码
long idLong = 18;
bool isBoolean = true;
string str= "str";
string strZh = "中文";
var tables = _db.TblA.FromSql($"exec spFunc {idLong},{isBoolean},{firstName},{lastNameZh}").ToList();
相关推荐
p***199413 小时前
MySQL中常见函数
数据库·mysql
m***066813 小时前
MySQL —— 配置文件
数据库·mysql·adb
e***136213 小时前
mysql之日期时间函数
数据库·mysql
heimeiyingwang13 小时前
如何用向量数据库构建企业级语义检索系统
数据库·mongodb·nosql·milvus
Web打印14 小时前
Phpask(php集成环境)之03安装mysql
数据库·mysql
p***199414 小时前
实操解决Navicat连接postgresql时出现‘datlastsysoid does not exist‘报错的问题
数据库·postgresql
weixin_4219947815 小时前
基于 .NET 9.0 的高性能轻量级令牌桶限流服务
.net·.netcore·令牌桶
xj1986031915 小时前
maven导入spring框架
数据库·spring·maven
ritxgt00615 小时前
MySQL出现Waiting for table metadata lock的原因以及解决方法(已亲测)
数据库·mysql
小跌—15 小时前
Redis的string数据类型
数据库·redis·缓存