MORE INFORMATION
CD-ROM: Correction To Sample Code
The typo is in the GetData function, for the two sample code files CacheAuthorsClearButton.aspx and AuthorsTrigger.aspx. Change:
Function GetData() As DataSet
Dim myDS As New DataSet()
Dim ConnStr As String
ConnStr =
"server=(local)\NetSDK;database=pubs;Trusted_Connection=yes"
Dim SQLSelect As String
SQLSelect = "SELECT au_id, au_lname, au_fname, "
SQLSelect &= "zip FROM Authors WHERE zip = '94609'"
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 =
"server=(local)\NetSDK;database=pubs;Trusted_Connection=yes"
Dim SQLSelect As String
SQLSelect = "SELECT au_id, au_lname, au_fname, "
SQLSelect &= "zip FROM Authors WHERE zip = '94609'"
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 68: Error In Code Sample
There is an error in the code sample on page 154.
Change:
Dim s(5) As String
To:
Dim s(4) As String
Page 119: Missing Closing Bracket In Code Sample
There is an error in the code sample on page 119.
Change:
<elementName2
attributeName1=value
attributeName2=value
attributeNameN=value
To:
<elementName2
attributeName1=value
attributeName2=value
attributeNameN=value />
Page 147: Error In Code Sample
There is an error in the code sample on page 147.
Change:
<machineKey
decryptionKey="autogenerate | value"
validation= "autogenerate | value"
validationKey="3DES | MD5 | SHA1"/>
To:
<machineKey
decryptionKey="autogenerate | value"
validation="3DES | MD5 | SHA1"/>
validationKey="autogenerate | value" />
Page 154: Missing Closing Bracket In Code Sample
There is an error in the code sample on page 154.
Change:
<remove
name="name"
To:
<remove
name="name" />
Page 196: Msg.Text Should Be Message.Text
There is an error in the code sample on page 154.
Change:
Else
Msg.Text = "Incorrect Username or Password: Try again."
End If
To:
Else
Message.Text = "Incorrect Username or Password: Try again."
End If
Page 307: Correction To Step 6
On page 307, in step 6,
Change:
sp_addrolemember 'db_datawriter','ASPNET'
go
To:
sp_addrolemember 'db_datawriter','ASPNET'
go
Page 408: Code Listing Typo
On page 408, the code listing for HelloService_CB.vb contains a typo.
Change:
Public Class Hello
To:
Public Class Hello_CB
Page 408: Code Listing Typo
On page 408, the code listing for HelloService_CB.asmx contains a typo.
Change:
<%@ WebService Class="ASPNETSBS.Hello_(B, HelloService_CB"%>
To:
<%@ WebService Class="ASPNETSBS.Hello_CB, HelloService_CB"%>
Page 438: Typo In GetData Function
On page 438, the code listing for CacheAuthors.aspx contains a typo. The typo is in the GetData function. Change:
Function GetData() As DataSet
Dim myDS As New DataSet()
Dim ConnStr As String
ConnStr = "server=(local)\NetSDK;database=pubs;Trusted_Connection=yes"
Dim SQLSelect As String
SQLSelect = "SELECT au_id, au_lname, au_fname, "
SQLSelect &= "zip FROM Authors WHERE zip = '94609'"
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 = "server=(local)\NetSDK;database=pubs;Trusted_Connection=yes"
Dim SQLSelect As String
SQLSelect = "SELECT au_id, au_lname, au_fname, "
SQLSelect &= "zip FROM Authors WHERE zip = '94609'"
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.
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.