Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat looks wrong in this?
    text
    copied!<p>private int DBUpdate() {</p> <pre><code>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)); } </code></pre> <p>/// 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</p> <hr> <p>Sergio: is this OK, for setting OleDbTypes explicitly?</p> <pre><code>///whatever ... new OleDbParameter("@problems",problems.Value), new OleDbParameter("@fdayact",firstday.Value), new OleDbParameter("@usid",user.ID) }; //then telling each one what they will be ... parm[0].OleDbType = OleDbType.VarWChar; parm[1].OleDbType = OleDbType.VarWChar; /// return (dal.UpdateRow(upd,false,parm)); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload