首页 > 其他分享 >Dapper QueryMultiple throws "No columns were selected"

Dapper QueryMultiple throws "No columns were selected"

时间:2023-11-17 14:12:16浏览次数:32  
标签:No selected throws QueryMultiple were commented columns

调试存储过程发现某字段NULL,拼成的SQL最后啥也没有了。。。
原因是存储过程没有执行到查询SQL语句

QueryAsync throws "No columns were selected" when stored proc doesn't perform a select statement #591

Closed     toannguyen83 opened this issue on Aug 27, 2016 · 18 comments   Closed    

QueryAsync throws "No columns were selected" when stored proc doesn't perform a select statement#591

toannguyen83 opened this issue on Aug 27, 2016 · 18 comments  

Comments

@toannguyen83     toannguyen83 commented on Aug 27, 2016

Tested on Dapper 1.42 and 1.50.2

The following sql statement will simulate creating a temp stored proc and execute it with dapper

create procedure #TestProcedure
as
begin

    -- basically a failed if statement, so the select is not happening and the stored proc return nothing
    if 1=0
    begin
        select 
            'Password' as ColumnName,
            'Cannot be the same as your username' as [Message]
    end

end

exec #TestProcedure
 

When using Query version, it works fine and no results return. When using QueryAsync version, it throws "No columns were selected" error.

I attached a code sample using microsoft localdb. The sample project is using Dapper 1.50.2 and structure similar to the one I submitted in #501

DapperBugReplication20160827.zip

相关文章

  • Photino.Blazor 升级.net8.0 记事
    趁着Photino.Blazor作者还没升级.net8之际,我发布版将photino.Blazor-2.6.0发布版升级到.Net8。1首先下载photino.Blazor-2.6.0的发布版https://github.com/tryphotino/photino.Blazor/releases/tag/v2.6.02。将所有项目升级最新.net8.0 3.将引用包都升级到最新版,重点是......
  • ERROR: Permission to stevenlong123/test.git denied to smith-bing. fatal: Could n
    第一次练习git提交代码到github时出现的错误。这里就是说github服务器拒接了我们,不支持远程连接。发现是因为我使用的是ssh来提交的,ssh是安全连接需要通信双方各有一对公钥私钥,github服务器不会自动交换公钥,需要手动在github存储库中部署自己电脑的公钥。使用git命令“ls-al~/.s......
  • P1486 [NOI2004] 郁闷的出纳员
    P1486[NOI2004]郁闷的出纳员有两种思路,均使用fhq-treap实现维护一个变量delta表示全局偏移量,对于新插入的数减去偏移量。使用fhq-treap,可以分裂出<mid的部分,直接丢掉。直接用fhq-treap维护一个类似于线段树的懒标记,每次放在根上即可。方法1#include<iostream>#include<r......
  • 电话问候语音制作-CCIT u-Law 8kHz, 8 bit Mono .Wav
    A.文字轉語音製作:使用免費開源軟件Balabolka(可粤语/普通话/英文,其他发音要安装语音包)下載:https://www.cross-plus-a.com/balabolka.htm1.先在文本框輸入想要轉換的文字。2.粵語發音:選擇SAPI5-->MicrosoftTracyDesktop[繁體中文(香港特別行政區)]3.按“ReadAloud”試聽......
  • pip生成与安装项目依赖包---提示:No such file or directory: 'requirement.txt'
    错误的原因:安装项目依赖包的文件命令: pipinstall-rrequirement.txt问题:ERROR:Couldnotopenrequirementsfile:[Errno2]Nosuchfileordirectory:'requirement.txt'解决:第一步,检查项目中是否存在文件“requirement.txt”,如果存在,则检查文件名与执行的文件名不一致......
  • Python 中将 None 转换为 0
    如何在Python中将None转换为0–码微(mwell.tech)some_number=Noneresult=some_numberor0print(result)#......
  • 如何解决AttributeError: 'DictVectorizer' object has no attribute 'get_feature_na
    这个错误通常是因为 DictVectorizer 对象没有 get_feature_names 属性。这可能是因为你使用的 sklearn 版本过低,或者是因为你没有正确地导入 DictVectorizer 类。要解决这个问题,你可以尝试升级 sklearn 版本,或者使用以下代码导入 DictVectorizer 类:fromsklearn.f......
  • 无GPU环境中运行出错解决方法:AssertionError: Torch not compiled with CUDA enabled
    在執行pytorch代碼的時候,突然看到報錯AssertionError:TorchnotcompiledwithCUDAenabled這說明了1.你pytoch确实安装了2.你安装的是cpu版本作为验证,你可以在python编辑器输入下列代码如果要在无GPU环境中运行,需要进行一些修改。1. 情况一:将出现‘gpu:0’的地方......
  • Snort3:概述(一)
    1简介Snort是一个免费的开源网络入侵检测系统(IDS)和入侵防御系统(IPS),由Sourcefire的创始人兼前CTOMartinRoesch于1998年创建。Cisco于2013年7月(花费27亿$)收购了Sourcefire。Snort使用一系列规则来帮助定义恶意网络活动,并使用这些规则来查找与其匹配的数据包......
  • Snort3: 开发环境(二)
    1系统选择snort3要求编译器版本g++>=5.0.0,这里使用Ubuntu1804。(部分)操作系统和默认编译器对照表系统版本默认编译器版本1Ubuntu18047.5.02Ubuntu20049.4.03Centos7.84.8.52依赖安装依赖:libpcap:https://www.tcpdump.org/。对具体版本......