我使用“Dapper”库与 MS Sql 连接。
当我调用存储过程时,它显示错误消息
找不到存储过程。
但存储过程它已经存在于数据库中。我该如何解决这个问题?谢谢。
public static string WrtoLogDb(string id, string id1)
{
using (var conn = new SqlConnection(connStrTest))
{
try
{
conn.Open();
var strf33_schD = conn.ExecuteScalar<int>("exec DelClsCourTimeTest", new { id, id1 }, commandType: CommandType.StoredProcedure);
return strf33_schD.tostring();
}
catch (Exception EX)
{
return EX.ToString();
}
}
}
Run Code Online (Sandbox Code Playgroud)