The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

code888 (1) [Avatar] Offline
#1
Hi Arlen
Thanks for a GREAT book!
I was wondering if you could shed some light on this.
If I get the autogenerated SQL string from the command builder after entering the code on top of paragraph 19.1 (page 211 in my edition) and adding this line:

Console.WriteLine("UpdateCommand text:
{0}", sqb.GetUpdateCommand().CommandText);

I get a very different string from the one published on table 19.1 for UPDATE. The string I get is:

UPDATE Classes SET
TeacherID = @p1 ,
ClassName = @p2 ,
Period = @p3
WHERE (
(ClassID = @p4)
AND (
(@p5 = 1 AND TeacherID IS NULL) OR (TeacherID = @p6))
AND (
(@p7 = 1 AND ClassName IS NULL) OR (ClassName = @psmilie)
AND (
(@p9 = 1 AND Period IS NULL) OR (Period = @p10))
)

Any idea on why the WHERE search condition is so different from the one published on the book? I'm using .NET 1.1 -
Thanks!