[英]WINFORM arithmetic overflow error converting expression to data type int
I am running an SQL Server query in a WINFORM to get data and fill a DataGridview. 我在WINFORM中运行SQL Server查询以获取数据并填充DataGridview。
I am searching for certain files extension. 我正在搜索某些文件扩展名。
I am using for examples like '%exe'
and get the results, for this and every file type there is in the database for examples; 我正在使用like '%exe'
示例并获取结果,为此,数据库中存在每种文件类型的示例; jpg, apk, cab etc… jpg,apk,出租车等…
The problem that I am having is when I search for file extension .dll every time I get the error: “arithmetic overflow error converting expression to data type int.” 我遇到的问题是,每次收到错误时都搜索文件扩展名.dll : “将表达式转换为数据类型int的算术溢出错误”。
I can run the same query inside SQL Server management Studio and search for the dll extension and get the results successfully. 我可以在SQL Server Management Studio中运行相同的查询,并搜索dll扩展名并成功获取结果。
Adding details: 添加详细信息:
I am also have a counter and Joins. 我也有一个柜台和加盟。
I can't paste the actual code with the tables name, so I substituted the names of the tables and columns. 我无法将实际的代码粘贴到表名称中,因此我将表和列的名称替换为。
select
t.column1, t.column2, t.column3 ,COUNT([column4]) as [Total]
FROM table1 j
join table2 f on f.column1 = j.column1 and j.column7 = 1
join table3 t on j.column3 = t.column6
join table4 lc on t.column6 = lc.column6
where j.column2 like '%dll' Group by t.column1, t.column2, t.column3 order by Total desc
As I mention before, the query runs ok in the WINFORM C# for every other file extension that I enter and search for with the exception of the DLL in the. 如前所述,对于我输入并搜索的所有其他文件扩展名,查询都可以在WINFORM C#中正常运行,但其中的DLL除外。
Thanks again. 再次感谢。
Any ideas? 有任何想法吗? Regards 问候
First of all, I want to thank everyone that took the time to read this thread. 首先,我要感谢所有花时间阅读此线程的人。
The solution was to change COUNT
to COUNT_Big
解决方法是将COUNT
更改为COUNT_Big
Once I did this my query executed successfully searching for the dll file extension. 完成此操作后,我的查询将成功搜索dll文件扩展名。
Regards, 问候,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.