简体   繁体   English

WINFORM算术溢出错误将表达式转换为数据类型int

[英]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.

相关问题 将表达式转换为数据类型 int 的算术溢出错误 - Arithmetic overflow error converting expression to data type int 重新编译SP后,“将表达式转换为数据类型int的算术溢出错误”消失了 - “Arithmetic overflow error converting expression to data type int” disappeared after recompiling SP 将表达式转换为数据类型nvarchar的算术溢出错误 - Arithmetic overflow error converting expression to data type nvarchar 使用C#和SQL Server将int转换为数据类型数值的算术溢出错误 - Arithmetic overflow error converting int to data type numeric using C# and SQL Server 更新EF模型会引发““将表达式转换为数据类型为datetime的算术溢出错误” - Updating EF model throws “”Arithmetic overflow error converting expression to data type datetime" 算术溢出错误将表达式转换为不带日期的页面上的数据类型datetime - Arithmetic overflow error converting expression to data type datetime on page without dates scope_identity引发System.Data.SqlClient.SqlException(0x80131904):将IDENTITY转换为数据类型int的算术溢出错误 - scope_identity throwing System.Data.SqlClient.SqlException (0x80131904): Arithmetic overflow error converting IDENTITY to data type int 将varchar转换为数值数据类型的算术溢出错误。 asp.net中的错误 - Arithmetic overflow error converting varchar to data type numeric. Error in asp.net 在var.net中将varchar转换为数值类型的算术溢出错误 - Arithmetic overflow error converting varchar to data type numeric in asp.net 流利的NHibernate在插入/保存时导致“将数字转换为数据类型数字的算术溢出错误” - Fluent NHibernate cause an “Arithmetic overflow error converting numeric to data type numeric” on insert/save
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM