----------------------------------------------------------- New Message on BDOTNET
----------------------------------------------------------- From: spark Message 4 in Discussion Hi Gaurav Thanks for your inputs - I was reading some of our internal mails as well, and just felt that this is better answered on the group. Also I am in the loop for a rather busy spell in office so forgive my delays. - You are _right_ there have been many things missed out in this code release and then again like mahesh pointed out : some things have been left out intentionally. Let me try explain : > First of all, please have a default page in place, from where I can navigate to other pages (Authors.aspx, AuthorsEdit.aspx). < will be done : or rather should be done. Also ideally this page should host links to source download and to the pubs vb project as well as other house keeping such as a changes log, current team, who to contact etc. For starters - kashi if you have time - can you put up a plain page with a link to Authors.aspx, or anyone who have ftp access to the pubs c# server. Variable naming should reflect its class - Authors.aspx.cs has myCommand (and the comment also talks about creation of a SQLCommand object) which is actually a SQLDataAdapter. < <grin/> - no comment. Blooper here. No exception handling around the Fill method invocation of the SQLDataAdapter since the SQLConnection shall be implicitly be opened during this call. What if the connection open fails for some reason? < I don't know - should this have been done now or not ? While in my honest reply I did not consider SEH,it was probably good that we didn't have to explain exception handling with what we did in that session. We actaully didn't get much further than explaining the data grid and the binding code and brief primer on what user controls are in the Friday session. Maybe a following section with some code tightening and some edit/update functionality would be good before we introcude mahesh's data access layer code. if(SortExpression!=string.Empty) is incorrect since for the first call, SortExpression will be set to null and string.Empty is actually a "" and not null!. Seein the debugger and you will see the coding working incorrectly, than is intended. Remember that all reference types are defaulted to null by the runtime, unless explicitly initialized. This works out for you since the setter for DataView handles this error for you. This should be changed to: if(SortExpression!=null && SortExpression!=string.Empty) < blooper. Once the DataSet has been filled, why is the sorting being done at the webserver, where its not suited for? Please understand that the concept of DataViews in ADO.NET is to mimic the views that we are familiar with in the database, and their sole purpose is to show data in a different manner, particularly data-reduction consequent to complex filtering. Sorting is more of a data re-arrangement, and if required, is best done by the database server for you. < while you are right on this gaurav, I would go with what is being currently done as a simple way to go about it. Lets demo sorting and pagination at the aspx front, the automated way and then move on to performance issues. - I compare this to kids who copy mb sized sorted files into memory and do linear searches throught them to find a value : while this is not the right way this will work for the first time. Opinion gaurav ? Do you think we are underestimating the audience ? Checks should be employed to ensure that the connection string read from the configuration file isn't null or empty string. What if the configuration file has no/empty entry for the connection string? < again maybe later. Finally, assuming that the authors table contains a million records. ADO.NET paging will crash land the application performance since it believes in fetching the entire lot first and then paging the results out, before writing to the grid. Instead, a SQL Server stored procedure should be written that will do the paging at the database server end and just return the relevant result set to you, making the pull efficient that getting the entire million records as XML to the webserver and then get the 3rd hundred block to be displayed to the user! < I clubbed this with the explanation two comment above - this will definitely happen in later version. Lastly, prior to uploading the source code, please ensure that the relevant project is set to be the Startup. I know its trivial, but since this initiative is intended to be a learning experience for all those who wish to work with the source code they download, the last thing they want is to press F5 and get an error. The current source upload has the PubsException set as the Startup project. < this is a blooper - this should not have been. I know how important it is for the begininer to be able get the code to work in the first 15 minutes he sits with it. Admittedly it lacks a lot of packaging :) Cheers rosh ----------------------------------------------------------- To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings. http://groups.msn.com/bdotnet/_emailsettings.msnw Need help? If you've forgotten your password, please go to Passport Member Services. http://groups.msn.com/_passportredir.msnw?ppmprop=help For other questions or feedback, go to our Contact Us page. http://groups.msn.com/contact If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list. mailto:[EMAIL PROTECTED]
