Im having some issues getting all the data from my sql server database. Below is one of the DateTime values i have stored in my database:
2012-12-31 21:39:08.8940
Unfortunately, when i run the same SProc via entity framework, i get the following instead:
2012-12-31 21:39:08
Is there anyway to correct this so all the data is being returned?
The SProc code is as follows:
CREATE PROCEDURE [dbo].[DataRetrieval]
@StartDateTime DateTime2(4) ='2012-12-31 21:59:08.2050',
@EndDateTime DateTime2(4) ='2012-12-31 21:59:08.2050',
@Pair nchar(6) ='EurUsd'
AS
SET NOCOUNT ON;
BEGIN
SELECT Pair,DateTime,Ask,Bid,AskVolume,BidVolume
FROM
dbo.ForexData
WHERE
PAIR = @Pair
AND ( DateTime = @StartDateTime
OR DateTime >= @StartDateTime )
AND ( DateTime = @EndDateTime
OR DateTime < @EndDateTime )
ORDER BY
DateTime
END
GO
Make sure that in your *.edmx, under the ComplexType section, the Precision property is filled correctly