Hi,
I execute this query in SQL Server 2005 Management Studio:
SELECT c.id, c.clientname
FROM NFClients AS c INNER JOIN
NFExportGroups AS eg ON eg.cid = c.id INNER JOIN
NFExportGroupInfo AS ei ON ei.exportid = eg.exportid
WHERE (ei.meterid = 4938) AND (NOT (eg.emailgroup IS NULL))
I get one row returned and it is correct.
Then I go to Visual Studio 2005, to my C-Sharp application, and I use the same query to populate two indexes of 'rowvalues', my trusty two-dimensional string array:
SqlCommand { rowvalues[i, 2] = sqldrExx.GetValue(1).ToString(); rowvalues[i, 3] = sqldrExx.GetValue(0).ToString(); } sqldrExx.Close();
This time, the SqlDataReader picks up two rows, and the second one, with a different c.id and c.clientname does have a NULL value for eg.emailgroup. I have verified that the value of comparedgroupids[i, 2] is 4938, and I have also confirmed that sqlcmdExx.CommandText is exactly the same as the query I run in the SQL Server Management Studio. Why do I get different results with same query on the same database
Thanks.
Dale