I am running an SQL Server query in a WINFORM to get data and fill a 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; jpg, apk, cab etc…
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.”
I can run the same query inside SQL Server management Studio and search for the dll extension and get the results successfully.
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.
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
Once I did this my query executed successfully searching for the dll file extension.
Regards,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.