Microsoft KB Archive/817760

= Microsoft ASP .NET Programming With Microsoft Visual Basic .NET Step By Step Deluxe Learning Edition Comments And Corrections =

Article ID: 817760

Article Last Modified on 4/23/2003

-

APPLIES TO


 * MSPRESS Microsoft ASP .NET Programming With Microsoft Visual Basic .NET Step By Step Deluxe Learning Edition, ISBN 0-7356-1814-3

-



SUMMARY
This article contains comments, corrections, and information about known errors relating to the Microsoft Press book Microsoft ASP .NET Programming With Microsoft Visual Basic .NET Step By Step Deluxe Learning Edition, 0-7356-1814-3.

The following topics are covered:


 * Page 14: Incorrect Path
 * Page 95: Error In Code Samples
 * Page 102: Error In Code Samples
 * Page 169: Typographical Error
 * Page 248: Error In Code Sample
 * Pages 296-297: Error In Code Sample
 * Page 317: Error In Code Sample
 * Page 326: Typographical Error
 * Page 350: Error In Code Sample
 * Page 469: Error In Code Sample
 * Page 471: Error In Code Sample
 * Page 566: Error In Code Sample



Page 14: Incorrect Path
There is an incorrect path at the bottom of page 14.

Change:

&quot;C:\aspnetsbs&quot;

To:

&quot;C:\MS Press Books\ASPNETSBS&quot;

Page 95: Error In Code Samples
The headings &quot;Global.asax&quot; and &quot;Web Forms page&quot; should be formatted as part of the code listing, not headings. The code samples should read:

'Global.asax 

' Web Forms page Response.Write(&quot;Value = &quot; & MyClassInstance.MyValue)

Page 102: Error In Code Samples
The headings &quot;Global.asax&quot; and &quot;Web Forms page&quot; should be formatted as part of the code listing, not headings. The code samples should read:

'Global.asax 

' Web Forms page Response.Write(&quot;Value = &quot; & MyClassInstance.MyValue)

Page 169: Typographical Error
There is a typograhical error in step 4 of the property table. Two controls are named Label2. The second label control should be named Label3.

Page 248: Error In Code Sample
There is an error in the code sample in Step 9 on page 248. The line break should be removed.

Change:

Label2.Text = &quot;Your favorite is &quot; _& DropDownList1.SelectedItem.Value & &quot;!&quot;

To:

Label2.Text = &quot;Your favorite is &quot; & DropDownList1.SelectedItem.Value & &quot;!&quot;

Pages 296-297: Error In Code Sample
There is an error in the code example in section 1. The connection string incorrectly uses &quot;datasource&quot; and &quot;integratedsecurity&quot; as parameters. The correct parameters are &quot;data source&quot; and &quot;integrated security&quot;. The code samples should read:

'Default constructor Dim mySqlCmd As New SqlCommand

'Passing in a query Dim SQL As String = &quot;SELECT au_id FROM authors&quot; Dim mySqlCmd2 as New SqlCommand(SQL)

'Passing in a query and a connection Dim mySqlConn As New _ SqlConnection(&quot;data source=localhost\NetSDK;database=pubs;integrated security=true&quot;) Dim SQL As String = &quot;SELECT au_id FROM authors&quot; Dim mySqlCmd3 as New SqlCommand(SQL, mySqlConn)

'Passing in a query, a connection, and a transaction Dim mySqlConn As New _ SqlConnection(&quot;data source=localhost\NetSDK;database=pubs;integrated security=true&quot;) Dim mySqlTrans As SqlTransaction = mySqlConn.BeginTransaction Dim SQL As String = &quot;SELECT au_id FROM authors&quot; Dim mySqlCmd4 as New SqlCommand(SQL, mySqlConn, mySqlTrans)

Page 317: Error In Code Sample
The code listing for Step 6 of the DataTable Collections sample is missing a line of code just before the line that begins Value.Text &= &quot;Table: &quot; & _

The code sample for Step 6 should read:

'Get each DataTable in the DataTable Collection 'and display each row value by appending it to 'the Text property of the Literal control.

Dim CurrentTable As DataTable Dim CurrentRow As DataRow Dim CurrentColumn As DataColumn

For Each CurrentTable in MyDS.Tables Value.Text &= &quot;Table: &quot; & _ CurrentTable.TableName.ToString & &quot; &quot; Value.Text &= &quot;- &quot; For Each CurrentRow In CurrentTable.Rows Value.Text &= &quot;  &quot; For Each CurrentColumn in CurrentTable.Columns

If Not CurrentRow(CurrentColumn) Is Nothing Then If Not IsDbNull(CurrentRow(CurrentColumn)) Then value.Text &= CStr(CurrentRow(CurrentColumn)) Else Value.Text &= &quot;NULL&quot; End If           Value.Text &= &quot;   &quot; End If     Next Next Value.Text &= &quot;- &quot; Value.Text &= &quot; &quot; Next

Page 326: Typographical Error
There is a typographical error in step 12 on page 326.

Change:

&quot;types dataset&quot;

To:

&quot;typed dataset&quot;

Page 350: Error In Code Sample
There is a typographical error in the code sample in Step 6 on page 350.

Change:

ConnStr = &quot;server=(local)\VSdotNET;database=pubs;&quot; & _ &quot;Trusted_Connection=yes&quot;Dim SQL As String

To:

ConnStr = &quot;server=(local)\VSdotNET;database=pubs;&quot; & _ &quot;Trusted_Connection=yes&quot; Dim SQL As String

Page 469: Error In Code Sample
There is an error in the CacheAuthors.aspx code sample on page 469.

Change:

Function GetData As DataSet Dim myDS As New DataSet Dim ConnStr As String ConnStr = &quot;server=(local)\VSDotNET;&quot; ConnStr &= &quot;database=pubs;Trusted_Connection=yes&quot; Dim SQLSelect As String SQLSelect = &quot;SELECT au_id, au_lname, au_fname, &quot; SQLSelect &= &quot;zip FROM Authors WHERE zip = '94609'&quot; Dim mySqlConn As New SqlConnection(ConnStr) Dim mySqlDA As New SqlDataAdapter(SQLSelect, ConnStr) mySqlDA.Fill(myDS) Return myDS End Function

To:

Function GetData As DataSet Dim myDS As New DataSet Dim ConnStr As String ConnStr = &quot;server=(local)\VSDotNET;&quot; ConnStr &= &quot;database=pubs;Trusted_Connection=yes&quot; Dim SQLSelect As String SQLSelect = &quot;SELECT au_id, au_lname, au_fname, &quot; SQLSelect &= &quot;zip FROM Authors WHERE zip = '94609'&quot; Dim mySqlDA As New SqlDataAdapter(SQLSelect, ConnStr) mySqlDA.Fill(myDS) Return myDS End Function

Because the SqlDataAdapter class can automatically open and close its own SqlConnection object, the SqlConnection object, mySqlConn, is not necessary.

Alternatively, you could explicitly create and open the connection, and pass it as an argument to the constructor of the SqlDataAdapter object. With this technique, you would also need to explicitly close the connection after filling and returning the DataSet to the caller.

Page 471: Error In Code Sample
The section entitled &quot;Understanding Expiration and Scavenging&quot; discusses how cached items are removed from the cache. This section contains a typographical error in the code example. The leading &quot;Caching.&quot; on &quot;Caching.CacheItemPriority.High&quot; is incorrect.

The code sample at the bottom of page 471 should be:

Cache.Insert(&quot;myDS&quot;, myDS, Nothing, DateTime.Now.AddMinutes(2), _  TimeSpan.Zero, CacheItemPriority.High, _   Nothing)

Page 566: Error In Code Sample
There is an error in the HttpModules configuration section on page 566. One of the elements in this file is missing a closing &quot;/>&quot; bracket. The code sample should read:



Microsoft Press is committed to providing informative and accurate books. All comments and corrections listed above are ready for inclusion in future printings of this book. If you have a later printing of this book, it may already contain most or all of the above corrections.

Additional query words: 0-7356-1814-3

Keywords: kbdocfix kbdocerr KB817760

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.