private int DBUpdate() {
DAL dal = new DAL();
string upd = "UPDATE [RPform] SET [ProjectName] = '@pname', [ProjectCode] = '@pcode', [Country] = @cnt, ";
upd += "[StartDate] = '@startdate', [FinishDate] = '@finishdate', [TotalParticipants] = @totpart, [ArrivalDate] = '@arrivedate', ";
upd += "[AirportTransfer] = @airtran, [AirportDate] = '@airdate', [AirportHours] = @airhour, [AirportMinutes] = @airmin, ";
upd += "[Problems] = '@problems', [FirstDayActivities] = '@fdayact' ";
upd += "WHERE [UserID]=@usid";
OleDbParameter[] parm = new OleDbParameter[] {
new OleDbParameter("@pname",projname.Text),
new OleDbParameter("@pcode",projcode.Text),
new OleDbParameter("@cnt",countries.SelectedIndex),
new OleDbParameter("@startdate",datestart.Text),
new OleDbParameter("@finishdate",datefinish.Text),
new OleDbParameter("@totpart",totalparticipants.Text),
new OleDbParameter("@arrivedate",datearrival.Text),
new OleDbParameter("@airtran",RadioButtonList1.SelectedValue),
new OleDbParameter("@airdate",dateairport.Text),
new OleDbParameter("@airhour",airporthours.SelectedIndex),
new OleDbParameter("@airmin",airportminutes.SelectedIndex),
new OleDbParameter("@problems",problems.Value),
new OleDbParameter("@fdayact",firstday.Value),
new OleDbParameter("@usid",user.ID)
};
return (dal.UpdateRow(upd,false,parm));
}
/// It causes no exceptions, but returns 0 rows affected. When same query executed from within MS Access it works fine. Hence I suppose the problem is sth with the handling of parameters ... but what? Thank you