I have an SQL statement in my C # program that looks like this:
SELECT * FROM XXX.dbo.XXX
WHERE Source = 'OH'
AND partnum = '1231202085'
ORDER BY partnum, Packaging, Quantity
When you run this query in SQL Server Management, the results are ordered as expected. My first 3 results have the same batch and packaging with sizes 32.0, 50.8 and 51.0.
However, when I run a query from my program, the first result is returned with a result of 50.8. The data type Number is decimal (18.9). I tried actuation, this doesn't seem to be a data type problem.
I can’t understand why he gets the average amount.
Thanks guys for the quick answers, but after a little testing, I found my problem in my C # code, and not in sql.
After receiving the query results, I hade:
if (PurchOrder.Read())
while (PurchOrder.Read())
, , while .
Ive if:
if (PurchOrder.HasRows == true)
.
, . .
-Cody