HELP: Baffled by bug (?) in SqlCeCommand:



I am getting strange results running a SqlCeCommand (v3.1) in a .NET
application.

It is a select command, and the bug (?) depends on the first time the
command is used to retrieve results.

If the table is entirely empty, then for the rest of the lifetime of the
SqlCeCommand, the WHERE clause is ignored. Later retrievals using the
command return *all* rows in the table, despite a parameter that is
supposed to filter results to a single day.

If the table has even one row on the first invocation, the command works
correctly for the entire session.

The command is created only once upon app load and reused several times.

I assume this is a bug. Maybe I just did something dumb.

Has anyone seen this before? Any suggestions?

Matt


Code snippets:


Upon app load:

sSQL =
"select entry_id, case len(entry_title) when 0 then '(no title)'
else entry_title end as entry_title, priority "
+ "from ud_entry "
+ "where entry_date = @target_date "
+ "order by priority";
_sqlcmdGetDTitlesAndNewByTargetDate = new SqlCeCommand(sSQL, _sqlConn);
_sqlcmdGetDTitlesAndNewByTargetDate.Parameters.Add("@target_date",
SqlDbType.DateTime);


Upon selecting a new date:

public DataTable GetDTitlesAndNewByDate(DateTime dateTarget)
{
_sqlcmdGetDTitlesAndNewByTargetDate.Parameters
["@target_date"].Value = dateTarget;

DataTable dt = new DataTable();
SqlCeDataAdapter da = new SqlCeDataAdapter
(_sqlcmdGetDTitlesAndNewByTargetDate);
da.Fill(dt);

DataRow dr = dt.NewRow();
dr["entry_id"] = 0;
dr["entry_title"] = "(new entry)";
dr["priority"] = 0;

dt.Rows.InsertAt(dr, 0);

return dt;
}

.



Relevant Pages

  • Wolfpack 4.3.10 Server Release
    ... Plug file descriptor leak in add command. ... This feature was flawed (it encourages players to ... Redesign of synchronization between commands, update and shutdown, ... The bug allowed players to delay ...
    (rec.games.empire)
  • coreutils-8.1 released [stable]
    ... run a command like this: ... If that command fails because you don't have the required public key, ... [bug introduced in coreutils-8.0] ... read-to-EOF and the inotify watch initialization would be ignored ...
    (gnu.announce)
  • Re: MoveRight in table fails at 1%: bug? workaround?
    ... temporary files as your macro runs, so that all changes can be undone. ... about erros at Selection.MoveRight command? ... >> Does anyone know something like a known bug about MoveRight? ... Using the Selection object makes for more convoluted ...
    (microsoft.public.word.vba.general)
  • Re: 8.0 rc.d scripts less verbose?
    ... bug, but it's a bug that we've come to depend on. ... This late in the release cycle I'm comfortable adding a knob, ... pre-command routine or the command itself failed. ... whatever reason), it is nice to have an approximate idea which one ...
    (freebsd-stable)
  • Re: in 2.6.23-rc3-git7 in do_cciss_intr
    ... Transport methods supported = 0x6 ... Coalesce Interrupt Delay = 0x0 ... If we've found the command, ... I still can't reproduce this bug. ...
    (Linux-Kernel)

Loading