According to the UI, there is a Batch Enrol from and to fields entitled only to CBNCII course. So once the user hit the save button it will set to Batch 1.
get the courses/programs dated between those to and from dates
loop through all courses/programes received in #2 and set their batch date.
Another option would be to create another table BatchCourse which will be a linking table that only stores a Batch # and CourseID. Concept is still the same though, when you do #3 you perform the insert vs. an update.
Remember to mark as answer if this post answered or solved your problem.
I appreciate your time looking into this however according to your #3 key point is apply a loop on all courses/programs obtained from the 2nd point and set their batch date.
With that stated, could you please provide me a short generic sample for this.
With that stated, could you please provide me a short generic sample for this.
Try this:
DataTable cdt = new DataTable();
DataTable pdt = null;
// get all the courses by data parameters
cdt = cmd.ExecuteDataset("GetMyCourses", MyParams).Tables[0];
for each (DataRow cdr in cdt.Rows)
{
// get the course id of this row
int courseID = Convert.ToInt32(cdr["courseID"]);
pdt = new DataTable();
// get all the programs for this row
pdt = cmd.ExecuteDataset("GetMyProgramsByCourseID", Params).Tables[0];
// loop all the program rows and get data from them if needed otherwise just use pdt datatable to bind to a control.
for each (DataRow pdr in pdt.Rows)
{
int programID = Convert.ToInt32(pdr["programID"));
}
}
Remember to mark as answer if this post answered or solved your problem.
sheen_buhay
Member
711 Points
539 Posts
Date range batching
Jan 30, 2012 06:16 AM|LINK
Hi,
I need help on how to set a certain batch no. on a specific date range.
For instance, if a student enrolled on a certain Course / Program dated from Feb. 1 - Feb 29, 2012. This will set as Batch 1 for Program CBNCII.
Here is the illustration screenshot: http://imageshack.us/photo/my-images/254/batchdates.jpg/
According to the UI, there is a Batch Enrol from and to fields entitled only to CBNCII course. So once the user hit the save button it will set to Batch 1.
Thanks.
SheenBuhay
b471code3
Star
13877 Points
2598 Posts
Re: Date range batching
Jan 30, 2012 12:45 PM|LINK
In your Button Click event you need to:
Another option would be to create another table BatchCourse which will be a linking table that only stores a Batch # and CourseID. Concept is still the same though, when you do #3 you perform the insert vs. an update.
sheen_buhay
Member
711 Points
539 Posts
Re: Date range batching
Jan 31, 2012 04:04 AM|LINK
@b471code3,
I appreciate your time looking into this however according to your #3 key point is apply a loop on all courses/programs obtained from the 2nd point and set their batch date.
With that stated, could you please provide me a short generic sample for this.
Thanks.
SheenBuhay
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: Date range batching
Feb 01, 2012 07:11 AM|LINK
Hi
Can you explain your question more clearly?
Do you want to batch the data in database by date range?
Can student enrolled from 1/15/2012 to 2/15/2012?
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
b471code3
Star
13877 Points
2598 Posts
Re: Date range batching
Feb 01, 2012 12:14 PM|LINK
Try this:
DataTable cdt = new DataTable(); DataTable pdt = null; // get all the courses by data parameters cdt = cmd.ExecuteDataset("GetMyCourses", MyParams).Tables[0]; for each (DataRow cdr in cdt.Rows) { // get the course id of this row int courseID = Convert.ToInt32(cdr["courseID"]); pdt = new DataTable(); // get all the programs for this row pdt = cmd.ExecuteDataset("GetMyProgramsByCourseID", Params).Tables[0]; // loop all the program rows and get data from them if needed otherwise just use pdt datatable to bind to a control. for each (DataRow pdr in pdt.Rows) { int programID = Convert.ToInt32(pdr["programID")); } }sheen_buhay
Member
711 Points
539 Posts
Re: Date range batching
Feb 02, 2012 01:45 AM|LINK
@Dino He - MSFT
yes, for instance if a student enrolled on a certain course/program on that specific date range.
Program Name: Math
Program Duration: 1/15/2012 to 2/15/2012
thanks.
SheenBuhay
Dino He - MS...
Star
8068 Points
1023 Posts
Microsoft
Re: Date range batching
Feb 02, 2012 06:10 AM|LINK
Hi
HTML: <form id="form1" runat="server"> <div> <asp:Label runat="server" id="Label1" Text="Math"></asp:Label> <br /> <br /> <asp:TextBox ID="TextBox1" runat="server" Text="1/15/2012"></asp:TextBox> <br /> <br /> <asp:TextBox ID="TextBox2" runat="server" Text="2/15/2012"></asp:TextBox> <br /> <br /> <asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" /> </div> </form> CS: protected void Button1_Click(object sender, EventArgs e) { string StartTime = TextBox1.Text; string EndTime = TextBox2.Text; string CourseName = Label1.Text; string BatchID = StartTime + EndTime; //Then save this Four fileds to Your DB make sure your Db Have this column //Next Time you can select the BatchID to find this record. }That's what I think about, if I mis-understand your question please comment, I'll follow up this thread.If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework