Errata

ASP.NET 2.0 Cookbook

Errata for ASP.NET 2.0 Cookbook

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page i
1

Depending on your configuration; in Web.Config and if you are getting
DB_E_ERRORSOCCURRED(0x80040E21) when trying to connect to SQL using OLEDB.

You may want to change your connection string to:

<add key="dbConnectionString" value="Provider=SQLOLEDB;Data
Source=localhostSQL_TEST1;Initial
Catalog=ASPNetCookbook;Trusted_Connection=Yes;UID=ASPNetCookbook_User;PWD=w0rk;Integrated
Security=SSPI" />

SSPI may solve your connecttion problem.

Note, my localhost has multiple instances of SQL.

Anonymous   
Printed Page 567
1st paragraph

Missing code C11QuickWebServiceVB2 or CS. Not found on download of product. Also,
sample point to a web service which doesn't exist

Anonymous   
Printed Page 969
C# code under //get the email server and send the email

This is an error of not using the newer, ASP.NET 2.0, functionality. The code as written in the book WILL
function correctly if the SMTP information is stored in appSettings instead of mailSettings.

To use the ASP.NET 2.0 functionality, the SMTP server settings should be stored in Web.config something
like this (not in appSettings):

<system.net>
<mailSettings>
<smtp from="from@sample.com">
<network host="smtp.sample.com"
port="25"
password="emailaccountpassword"
userName="emailaccountusername" />
</smtp>
</mailSettings>
</system.net>

At that point, the code under "//get the email server and send the email" can be as listed below, because
ASP.NET 2.0 will automatically pick up the SMTP settings if they're listed in the Web.config as per above.
FWIW, it can also automatically pick up the emailMessage.From from the Web.config.

//get the email server and send the email
SmtpClient client = new SmtpClient();
client.Send(emailMessage);

Anonymous