MonthDropDownList
我有一个名为由 sql 数据源限定的月份组成的下拉列表。现在我想访问MonthDropDownList
like的值
MonthDropDownList.selecteditem++.
所以
if MonthDropDownList.selecteditem=January
then MonthDropDownList.selecteditem++=Febraury
我怎么能做到这一点???
这是我的代码
DataClassesDataContext db = null;
db = new DataClassesDataContext();
tblAdvance advance = new tblAdvance();
advance.StudentID = Convert.ToInt32(StudentNameDropDownList.SelectedValue);
advance.FromMonth = FromMonthDropDownList.SelectedItem.Value;
advance.UptoMonth = ToMonthDropDownList.SelectedItem.Value;
advance.AdvanceAmount = Convert.ToInt32(txtAdvanceAmount.Text);
advance.RollNo = Convert.ToInt32(txtRollNo.Text);
db.tblAdvances.InsertOnSubmit(advance);
db.SubmitChanges();
db.Connection.Close();
db.Dispose();
for (int i = FromMonthDropDownList.SelectedIndex; i <= ToMonthDropDownList.SelectedIndex;i++ )
{
DataClassesDataContext dc = null;
dc = new DataClassesDataContext();
tblTotalFee bill = new tblTotalFee();
bill.StudentID = Convert.ToInt32(StudentNameDropDownList.SelectedValue);
bill.MonthName=FromMonthDropDownList.SelectedIndex[i]
bill.DueFromPreviousMonth = 0;
bill.ECAFee = 0;
bill.HostelFee = 0;
bill.LateFeeCharges = 0;
bill.MonthlyFee = 0;
bill.TransportFee = 0;
bill.TotalFeeThisMonthAlongwithDueinthismonth=0;
dc.tblTotalFees.InsertOnSubmit(bill);
dc.SubmitChanges();
I want something like the blockquoted line
dc.Connection.Close();
dc.Dispose();
}