Tutorial :Can someone show me example for running a stored procedure twice and get diff results?


For the past few weeks I have been really struggling doing something that should be really simple!

I have a stored procedure in a database which I call twice. Each call results in totally different data. I need the entity framework to treat it like this

At the moment it caches everything

So I am going to ask for help in a different way!

Could someone show me how do this in this situation:

tblInvoice table  Amount Float  InvoiceDate dateTime    Invoice Data:  AccountID: 1 InvoiceDate: 12 Dec 2009 Amount: 100  AccountID: 1 InvoiceDate: 11 Dec 2009 Amount: 150  AccountID: 2 InvoiceDate: 11 Nov 2008 Amount: 150  

Stored Procedure spGetInvoicesForDateRange - Returns all invoices for date range

  1. spGetInvoicesForDateRange 01 Dec 2009 - 31 Dec 2009
  2. spGetInvoicesForDateRange 01 Nov 2008 - 30 Nov 2008

At present, with my code executing 2 above would still return the results of 1 but executing 2) should only return the invoice for 11 nov 2008

My model is generated using Entity Framework but my context inherits from ObjectContext so I cant use ObjectTrackingEnabled

If someone could show me how to do the above I can then try to adapt it to my situation



Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »