I have a VB.Net program that will basically make a query to a remote MS-SQL DB using TSQL, return two columns (normally 4 rows/records), 1 is a datetime and 1 is a double. I will then need to return the average of the doubles (which is easy in VB.NET).
As I will need to run this query perhaps 1000 times an hour (programmatically with different input parameters for the query), I am looking for the most efficient way to code this up so that it will take the shortest time to run. I tried SQLDataAdapter and then using dataAdapter.Fill and sometimes it returns an empty set although the raw select query has values returned.
Is there any alternative suggestion? Speed is the key here.
Thanks in advance!
The fastest way to run a query in .NET is by using the SQLDataReader
EDIT: Agreed that this will not give you much of a speed difference with the size of your dataset, but the overhead to load the SQLDataReader does have a lighter footprint. As noted, probably not very noticeable, but valid none the less.