 |
BOOK: Beginning ASP.NET 2.0 and Databases  | This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 and Databases by John Kauffman, Bradley Millington; ISBN: 9780471781349 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 2.0 and Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

September 27th, 2006, 07:47 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
WOW--TIO-0905 VERY confusing
This is my fifth Wrox book and I have loved them--this one is quite a huge dissapointment. I agree with the user below, there are many typos, errata is not current, every "Try It Out" uses different nomenclature ex. TIO-0906...-1 ver01, some refer to wrong versions....wow.
Then there is TIO 0905. I am definetely a beginner and I can't understand this. First..the instructions, (step 5) state ONLY to put "WHERE state=IsNull(@state, state)" HOWEVER, the "How it works" starts discussing "WHERE state=@state AND state = IsNull(@state, state)"
WHERE DID the book tell you to do that. So what is the author explaining in the How it works..what he told us to do...or this new line?
Also, I am assuming you are trying to do two things...get the list completely populated from the start, or have it not populated until a choice is made.
Can't you do the first with the "Where state=IsNull(@state,state)" (not sure why you need the "Where state=@state AND state....")
The second you can get from just Where state = @state
So, if you want the entire list: WHERE state = IsNull(@state,state)
If you want no list, then selection: WHERE state = @state
I must be missing something and have no idea what is going on with this example.
I am VERY dissapointed that this forum is not populated and appears to not be moderated?
Again, not trying to be harsh..I have loved these books up to this point (I own VB 2005 for beginners and VB 2005 Pro, ASP.NET 2.0 for beginners, Beginning ASP.NET 2.0 and Databases and I own Instant Results)--this one is horrible. I was planning on buying ASP.NET 2.0 and Databases Pro when it comes out--but not if its like this.
Regards,
Rob Searing
|
|

September 27th, 2006, 09:49 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Rob. We must be going through this book on the same day. :) I hear you about the mistakes -- they only get worse, too. Just wait until you get to page 262. There are several errors on that page even BEFORE you get to the place where it tells you to "go look at the properties window" and then proceeds to give you instructions for changing controls *inside the Property BUILDER*! Augh! It's really frustrating because I think the examples are perfect, but clearly someone dropped the editing ball in a major way.
Anyway, regarding TIO-0905, I saw this several times in various places in the book. It's almost as if revisions were made but then those revisions weren't worked back into the examples (or vice-versa, changes were made to the examples that weren't worked back into the expository text).
If gets even worse when you consider the fact that the example works just fine even if you completely leave out the IsNull attribute, and of course the book doesn't explain why that's the case either.
|
|

September 27th, 2006, 09:52 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Wups, I meant to say page 263 above. I guess I need an errata sheet of my own! :D
|
|

September 28th, 2006, 07:28 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Pat,
Phew--thought I was crazy. I've never owned a Wrox book this poorly edited. I laughed, because as I kept reading, it got worse. This book could have been SO much better. I really hope that the "Pro" book released in February is much better.
The only thing I can chalk the behavior up to is that:
WHERE state = @state returns an empty list first because the parameter is null as set with the value of "(Chose a state)", value="". Once you pick a state, then it is not null, so refers to the valid parameter, "@state" which is set.
WHERE state = IsNull(@state,state) will return the entire list because the "@state" is actually null at first, so it refers to "state"---thus WHERE state=state would return all the states. Once @state is an actual "picked" state, then it would return only those states.
Assuming my logic is correct above, then I have NO idea why they use WHERE state=@state AND state = IsNull(@state, state).
:)
Rob
|
|

September 28th, 2006, 03:23 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I wonder if you might be able to answer another question. I'm trying to think of a non-coding way to make 0904-0906 show ALL the states before the user makes a selection (instead of just being blank until they make a selection). The only thing I've been able to come up with would be a substitution kludge with a second grid and manipulation of the .visible prop, which is kinda cheesy.
The problem of course being that there doesn't seem to be a way to temporarily ignore the WHERE clause.
Any thoughts would be appreciated. :D
|
|

September 28th, 2006, 03:49 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 238
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Actually, I got that to work. I'm not sure what you mean by "non-coding"--I'm a beginner, but if you change the code to:
WHERE state = IsNull(@state,state)
This works. Make sure you change the flag mentioned in the book--something that says something like "ignore when null"..something or other.
The reasoning behind why above works is that the first parameter "@state" will be looked at first. If it is null, it will look at the second parameter "state". Well, since the first value is null (the "(Please check a state)" that was entered into the list with a value of "" (null)...then it will look at @state first. Since it is null--it looks at "state". Well..that is the same as saying "WHERE state = state" which is all the states. You will get the entire list of all states.
Try it.
:)
Rob
|
|

September 28th, 2006, 05:23 PM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Perfect, thanks Ron! :D
|
|

October 12th, 2006, 12:19 PM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
John Kauffman here, I'll give you a hand.
you wrote:
>>>>>>>>>>>>>>>>Then there is TIO 0905. I am definetely a beginner and I can't understand this. First..the instructions, (step 5) state ONLY to put "WHERE state=IsNull(@state, state)" HOWEVER, the "How it works" starts discussing "WHERE state=@state AND state = IsNull(@state, state)"
>>>>>>>>>>>>>>>>
TIO 0905 has four steps (page 229-230).
|
|

October 12th, 2006, 12:24 PM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
RSearing:
regarding followign post:
>>>>>>>>>>>>>>>>>>>>>
I wonder if you might be able to answer another question. I'm trying to think of a non-coding way to make 0904-0906 show ALL the states before the user makes a selection (instead of just being blank until they make a selection). The only thing I've been able to come up with would be a substitution kludge with a second grid and manipulation of the .visible prop, which is kinda cheesy.
The problem of course being that there doesn't seem to be a way to temporarily ignore the WHERE clause.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
If I understand your objective corrrectly, that is what Brad adn I covered in TIO 09-06:
"... with a Default setting that shows all the records in teh GridVIew"
The trick, as PatFrank pointed out, is explained in the 0906 How IT Works, starting with the first para on page 233.
If there is a value in @state, then the matches for that state will be shown (the ase after teh master control has had a selection). If @state is empty (teh defualt case, before the master is clicked) then teh statemetn will return all the states that match "state=state", which means all the states.
|
|

October 12th, 2006, 12:36 PM
|
|
Authorized User
|
|
Join Date: May 2005
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
RSearing:
I'd like to address an earlier difficulty where you felt the book changed syntax between the TIO and the HIW.
(I think you are referring to 0906):
>>>>>>>>>>>>>>>>>>>>>
Then there is TIO 0905. I am definetely a beginner and I can't understand this. First..the instructions, (step 5) state ONLY to put "WHERE state=IsNull(@state, state)" HOWEVER, the "How it works" starts discussing "WHERE state=@state AND state = IsNull(@state, state)"
WHERE DID the book tell you to do that. So what is the author explaining in the How it works..what he told us to do...or this new line?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You are right on the instructions, Step 5 says to enter "... = ISnUll(@state,state)"
But in the HIW, the sentence starts with "To visualize the clause that SQL executes..."
By that I meant that this is not the cluase that you typed, but rather this is how you can think of what SQL sees. I am trying to get the reader to visualize what SQL "sees" when the master control has a selection and what SQL "Sees" when there is no selection. In the future I will try to think of a more explanatory clause then "Visualize..."
I completely sympathize with you on this exercise. It is one of the hardest in the book because of the complex SQL statement. And the complexity is based on a SQL trick many people did not learn in their college courses. But I felt that it was a solution to a common request, and so I included it in the book. I have read your frustration, but I hope in the end that the techniques we presented (some of which were barely known outside of Brad's group at Microsoft) are worth the hassles.
|
|
 |