i have a 3-tier architecture...trying to insert something with checkboxlist...
would this bit of code even work? every time i try to insert...i get a fail.
protected void submitButton_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
int intResult = 0;
sBLL scBLL = new sBLL();
sBO scBO = new sBO();
sDAL scdal = new sDAL();
scBO.scholarshipName = scNameText.Text;
scBO.orgID = 1;
try
{
intResult = scBLL.Insert(scBO);
if (intResult > 0)
lblMessage.Text = "New record inserted successfully.";
else
lblMessage.Text = "failed";
}
catch (Exception ee)
{
lblMessage.Text = ee.Message.ToString();
}
finally
{
int sID = scBO.sID;
foreach (ListItem li in CheckBoxList1.Items)
{
if (li.Selected)
{
mascidBLL masciBLL = new mascidBLL();
mascidBO masciBO = new mascidBO();
masciBO.sID = sID;
masciBO.majorID = int.Parse(li.Value);
}
}
}
scBO = null;
scBLL = null;
}
i have a bll, bo and a dal if that helps.
thanks in advance