Wrox Programmer Forums
|
BOOK: Wrox's SQL Server 2005 Express Edition Starter Kit ISBN: 978-0-7645-8923-2
This is the forum to discuss the Wrox book Wrox's SQL Server 2005 Express Edition Starter Kit by Rajesh George, Lance Delano; ISBN: 9780764589232
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's SQL Server 2005 Express Edition Starter Kit ISBN: 978-0-7645-8923-2 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
 
Old March 16th, 2006, 11:22 AM
Authorized User
 
Join Date: Jan 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need a Master-Detail Form - Updateable & Printable

Hi all,
I did my best to do all the "Try It Out" programs in Chapter 4 and I got (1) MyDBDataSet, (2) PersonBindingSource, (3) PersonTableAdapter, (4) PersonBindingNavigator, (5) BookBindingSource, (6) BookTableAdapter, (7) PageSetupDialog, (8) PrintDocument and (9) MenuStrip on the Component Tray appeared in the bottom of the screen - this outcome of my results is not perfect as Figure 4-5 on Page 66 and Figure 4-12 of the book indicate. I did not get the FK_Book_PersonBindingSource (of Figure 4-5) and the printed result (of Figure 4-12). I tried to correct/repair the Master-Detail Form by using the Binding Source, Binding Navigator, Typed Dataset and Table Adapter of the Component Tray. Does anyone know how to get FK_Book_PersonBindingSource appeared on Figure 4-5? I have a hard time to undertand the Steps 1,2,3... of "Try It Out" of Making a Master-Detail Form Updateable on Page 66, and the "Printing" Steps 5 and 6 on Page 77. Please help and advise. Can the authors of this Book help and give some tips?
Thanks in advance, Scott Chang

 
Old March 20th, 2006, 03:10 PM
Authorized User
 
Join Date: Dec 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Scott,

I am trying to plough my way through the nook to but I have only just started to monitor this forum.

Are you still having problems?

I have been through Chapter 4 and have only found a problem with trying to see the data actually updated which I have covered in another thread.

If you are:

1) To get FK_Book_PersonBindingSource in the component tray you must complete the Try It Out, steps 1 -5, on pages 61 & 62. Let us know exactly what problems you have if any.

2) Are you having difficulty understanding the steps on the Try It Out on page 66 or is it that you are unable to verify that you have updated the database. (If you have been unable to complete 1) above then I guess you will not have any success on this one.

3) What exactly are you having difficulty with Steps 5 & 6 on the Try It Out on page 77.

I will try to help if possible but I am only learning this as a retirement hobby. I am not a professional but do normally have time.

Regards

Weeble :)
 
Old March 23rd, 2006, 10:55 AM
Authorized User
 
Join Date: Nov 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Weeble, Thanks for your response.

I am a computer hobbyist too.

1) The DataSet, BindingSource, TableAdapter and Binding Navigator in the Component Tray are very confusing to me. I think I did not get them right by doing the "Try It Out" Steps when I tried to get the results shown in Figure 4-5 on Page 66 for the first time. Last night, I deleted all the things in the Component Tray, but all the old source codes are still there. I ran the project and I got many errors. Do you know how to eliminate the old source codes and get the right items of the Component Tray in Figure 4-5? I want it for updating the Master-Detail Form.

2) If I get the Master-Detail Form right, I think I can try to get the results of Figure 4-12 printed out.

Please help and advise.
Scott Chang

Scott Chang
 
Old March 23rd, 2006, 01:18 PM
Registered User
 
Join Date: Mar 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by BigOcean


1) The DataSet, BindingSource, TableAdapter and Binding Navigator in the Component Tray are very confusing to me. I think I did not get them right by doing the "Try It Out" Steps when I tried to get the results shown in Figure 4-5 on Page 66 for the first time. Last night, I deleted all the things in the Component Tray, but all the old source codes are still there. I ran the project and I got many errors. Do you know how to eliminate the old source codes and get the right items of the Component Tray in Figure 4-5? I want it for updating the Master-Detail Form.
Hi Scott,

One of the cool things about the IDE is that it 'writes' most of the overhead code. One of the not-so-cool things is that the code is hidden, hard to find, and often hard to understand. You could go back through all of the .cs files and remove all references to the component but that is a lot of work and will probably result in other errors. I'd suggest you simply delete all of the project files and start again. Of course, you can also use the code samples for the book.

You might take a look at pages 155-156 for an explanation of the component tray and the contents.

HTH...
Sturdy
 
Old March 24th, 2006, 06:31 PM
Authorized User
 
Join Date: Dec 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi everyone,

Sturdy is right about the "overhead code". In 2005 version this code seems to be hidden further away than in the previous couple of versions. Theoretically we shouldn't really need to go in there and change anything.

Normally deleting something from a form is not a problem as the relevant code gets cleared automatically. Of course any custom code that we add ourselves (e.g. step 3 on page 67) that references any of the deleted items will need to be deleted manually.

I haven't tried what you did but if we are talking about the hidden code then I wonder if we need to be careful about the order in which we delete items from the Component Tray.

No matter what though, in the situation that you find yourself in I fully agree with Sturdy that the best thing would be to start again.

Regards

Weeble
 
Old March 25th, 2006, 12:44 PM
Authorized User
 
Join Date: Jan 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Sturdy and Weeble, Thanks for your response.

1) I took your advise and re-started my Client Database Application from the Try It Out "Creating a New Project" on Page 44 to the Try It Out "Creating a Project with Add Existing Item" (of Creating a Master-Detail Form) on Page 63. I have a hard time to do Step 3 of the Try It Out on Page 63 to change the Files of Type dropdown to Data Files (*.xsd;*.xml;*.mdf;*.mdb) to see MDF files in directories.
I am stuck in this place and not able to a Master-Detail Form now. I believe I had the same difficuty before when I tried last time. That is why I said I did my best to get the items of the Components Tray.
Please help and tell me whether you had difficuties in the Try It Out Step 3 on Page 63 and whether you got the items/icons "MyDBDataset", "PersonBindingSource", "PersonTableAdapter", "PersonBindingNavigator", "BookBindingSource", "BookTableAdapter" and "FK_Book_PersonBindingSource" (as shown on Figure 4-5 on Page 66) exactly in your project as you followed the instructions of the Step 3 on Page 63 to the Step 8 on Page 65.

2) I did listen to the http://msdn.microsoft.com/vstudio/express/ Resource for Learning Visual Basic Video Lesson 8: Obtaining Data from a SQL Server 2005 Express Edition Data. In this Video Lesson, the instructor creates a different Master/Detail Form by changing the properties of the Form and source codes of Subs in the Form. This is why I attempted to correct my old Master-Detail Form before. I think that the Lesson 8 tell the learners that the Binding Source, Binding Navigator, Typed Dataset and Table Adapter of the Master-Detail Form should be correctable, if necessary. Any comments on the correction of the items of Component Tray for the Master-Detail Form by changing the property or/and adding (or modifying) the source code?

Please advise me to solve my problem stated in 1) and comment on 2).

Thanks again,
Scott Chang

 
Old March 25th, 2006, 02:40 PM
Authorized User
 
Join Date: Jan 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sturdy & Weeble,

Step 3 of Try It Out on Page 63 can not be done in my PC. I managed to get the MyDB, etc. and did the Steps 1, 2, and 3 of Try It Out Making a Master-Detail Form on Page 64. But I do not know how to do the Step 4 on Page 64 and thus,I can not get the Figure 4-3 on Page 64. So I can not do the Steps 5 and 6 on Page 65 for FK_Book_PersonBindingSource which was my problem in my previous trial. Please help and tell me how to complete the Steps 4, 5, and 6 on Pages 64 and 65 - to get FK_Book_PersonBindingSource eventually.

Thanks,
Scott Chang

 
Old March 26th, 2006, 04:52 AM
Authorized User
 
Join Date: Jan 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Sturdy and Weeble,

Update my post:

(1) I managed to get Steps 4, 5, 6, 7, & 8 right and FK_Book_PersonBindingSource appeared in the Components Tray.
I went on to do "Making a Master-Detail Form Updateable" on Pages 66-68. I ran the program and I got the following dialog box:
  Microsoft Visual Basic 2005 Express Edition
  There were build errors. Would you like to
  continue and run the last successful build?
                      |Yes| |No|
I clicked "Yes" and I got the old results.
Is it the right outcome from the "Making a Master-Detail Form Updateable" Try It Out? Please respond and comment if it is not right.

(2) I have 3 questions to ask you:
(i) When I typed the following 3 lines of source code (on Page 67):
     MessageBox.Show(
     "Error: Check that a valid record number has been input, Save
     Person information first")
    The second line appears in brick color. It it right or not? If it is not right, what should I do to correct it?
(ii) How can I make the line numbers appear on the left of the source code?
(iii) I did/could not get the "Toolbox" thumbtack button appeared on the left side of the screen. How can I get it after I have "Toolbox" out from the "View"?

Please respond.

Thanks,
Scott Chang

 
Old March 29th, 2006, 05:10 PM
Authorized User
 
Join Date: Dec 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Scott,

Sorry for the delay in replying Scott but I have been given an unexpected home decorating project from my wife which has severely curtailed my time lately.

(1) No it is not the right outcome for the Master-Detail Form Updateable. Visual Studio should give you error messages that enable you to pinpoint the lines of code that are giving you the problem. Your actual problem could be the line that you refer to in (2)(i).

(2)(i) The book shows the code on two lines. Try putting the two lines together on one line. It appears to be split over two lines in the book because there is not enough room on the page for it to be on one line. Visual Studio cannot parse the line correctly because there is no continuation character (underscore). This means that the second line is reported as an error hence the reason it is shown in brick colour. This would be enough to cause build errors (see (1) above).

(2) (ii) ACTIVATE the 'Tools' menu
- SELECT the 'Options' menu item and the Tools Options dialog box should be displayed.
- From within the dialog box NAVIGATE down to the 'Text Editor' section
- EXPAND the items underneath ththe 'Text Editor' heading.
- NAVIGATE to the 'All Languages' or 'Basic' item
- EXPAND the items underneath the 'All Languages' or 'Basic' heading
- SELECT the 'General' item
- CHECK the 'Display' 'Line Numbers' option
- CLICK the 'OK' button

The ability to display line numbers is really included as a 'throwback' to the good old days when BASIC language interpreters always included line numbers (yes I am old enough to remember so no age jokes please!). In those times we used to write lines like "GOTO 255" that is now accepted as bad practice (hence the reason why it is disabled by default). Unless you have a really good reason to display line numbers then avoid it as using it can lead to 'spaghetti code'.

I would point out that when in Code Editor the line number and character/column number of the cursor position is diaplay on the right-hand side of the status bar.

(iii) If you have lost the 'Toolbox' you should be able to display it by ACTIVATING the 'View' menu and then selecting the 'Toolbox' item (alternatively use the shortcut 'CTRL + ALT + X'.

Hope that this helps.

Weeble
 
Old April 10th, 2006, 12:53 PM
Authorized User
 
Join Date: Nov 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Weeble, Thanks for your response.

I spent time to pick up the VBExpress programming in the last several days. I re-start the MyFirstApp anf MasterDetail projects.
I still missed the steps 1-5 on Pages 61-62 and I did not get the FK_Book_Person shown on Figure 4-4, Page 65. Do you have any ideas
for me to fix this problem and to get the FK_Book_Person? Please respond.

Thanks in advance,
Scott Chang


Scott Chang





Similar Threads
Thread Thread Starter Forum Replies Last Post
master-detail hhpatek ADO.NET 0 April 3rd, 2008 02:53 PM
Master Detail prasanta2expert Access VBA 1 October 1st, 2007 06:37 AM
master/detail beeyule Dreamweaver (all versions) 1 January 18th, 2005 02:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.