This code generates and Null Reference exception. Exception comes at the line where the parameter array is initialized. What can be the problem? I don't know howto follow the stack-trace and work any logic over it. thanks in advance.
DAL dal = new DAL();
string SQL = @"INSERT INTO Assets ([AssetName],[AssetType],[Model],[Description],
[PurchaseValue],[SalvageValue],[Currency],[DateAcquired,[DateRetire],[ImagePath],
[InUse])
VALUES (?,?,?,?,?,?,?,?,?,?,?)";
OleDbParameter[] par = new OleDbParameter[]{
new OleDbParameter("@assetname",name.Text),
new OleDbParameter("@assettype",assettypes.SelectedValue.ToString()),
new OleDbParameter("@model",model.Text),
new OleDbParameter("@description",description.Text),
new OleDbParameter("@purchasevalue",purchaseval.Value),
new OleDbParameter("@salvagevalue",salvageval.Value),
new OleDbParameter("@currency",currencies.SelectedIndex),
new OleDbParameter("@dateacquired",purchasedate.Value),
new OleDbParameter("@dateretire",purchasedate.Value.AddYears((int)lifetime.Value)),
new OleDbParameter("@imagepath","N/A"),
new OleDbParameter("@addedby",MDIParent1.User.ID)
};