Tables created on the fly
Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4619
Printed Date: 21-Aug-2025 at 6:38pm
Topic: Tables created on the fly
Posted By: BillG
Subject: Tables created on the fly
Date Posted: 04-Dec-2013 at 5:53am
I know that my DevForce entity model needs to know my tables ahead of time to take a snapshot. But how do I handle this situation. I have a base table named PercapHist. Each month a new table is created in a stored procedure. (ex PercapOEDues1301, PercapOEDues1302 etc.)
In a certain routine I need to know if the percap routine was run for a previous month or already run for the current month. such as the following
string thisMonth = (percapMonth.Year + percapMonth.Month).ToString();
string percapThisMonth = "PercapOEDues" + thisMonth;
DateTime lastPercap = percapMonth.AddMonths(-1);
string lastMonth = (lastPercap.Year + percapMonth.Month).ToString();
string percapLastMonth = "PercapOEDues" + lastMonth;
Now I need to query either of the two tables PercapThisMonth or PercapLastMonth and see if they have any rows in them.
|
Replies:
Posted By: kimj
Date Posted: 04-Dec-2013 at 8:47am
The mapping to the storage layer, which is done by EF not DevForce, is static and can't be changed at runtime. You're best bet here is probably a stored proc query or view.
|
Posted By: smi-mark
Date Posted: 04-Dec-2013 at 8:48am
Can you have a stored procedure that will return the data based on the year/month you pass to it, and then map the stored procedure to return your PercapHist entity?
|
|