November 2008 - Posts

Solving a Mystery About 'BC30205: End of statement expected'

A reader of my book ran into the strangest problem that had me going around in circles. He was working through one of the ASP.NET 3.5 examples in Visual Web Developer 2008 and was getting weird errors like these:

error BC30205: End of statement expected.
error BC30451: Name 'q' is not declared.
error BC30451: Name 'itm' is not declared

The reader had entered the VB code and markup exactly as required (using the single page model). Even dropping my working .aspx file into his site still caused the errors. Why?

After downloading the complete chapter code, the reader noticed the key difference - his site didn't have a Web.config file! Without a web.config file, the VB compiler just doesn't know what to do. Everything is wrong at that point and the IDE laces the code with squiggles.

Why didn't he have a web.config file? Well, if you choose the 'Empty Web Site' option in VWD 2008, that's what you get - an empty web site without a web.config.

What makes this strange is that my example code included a web.config file. My best guess is that one of those VWD wizards such as Configure Data Source (SqlDataSource) needs to store stuff in a web.config file.  If it doesn't find one, it silently adds it and goes about its business. Not all designers provide this service, so the existence of a web.config can be hit and miss - if you've used the Empty Web Site option.

Anyway, I've marked this as a bug (errata) in the book. The moral of the story is that your code can be perfect but unless the configuration tells the compiler what to expect, you'll get misleading error messages like 'error BC30205: End of statement expected. '

Ken

Doing CRUD Operations in Silverlight 2 Against ADO.NET Data Services

Many of us have been struggling to create business-oriented (LOB) forms using Silverlight 2 and ADO.NET Data Services. There are plenty of community samples on reading data, but a dearth of real-world content on creating and updating records.

The Silverlight SDK team has been paying attention to the community feedback and posted some tutorials on doing CRUD with Silverlight 2. Good work, team!

I've successfully completed two of the tutorials - creating a data model and inserting data. However, beware of the cross domain security issues. If you get a JavaScript 'Access Denied' error, be sure you're hosting the Silverlight web application and the data service (.svc) on the same domain. Let's hope a Silverlight update can remedy that issue (securely) some day.

Here are some tutorial/documentation URLs of note for Silverlight 2 developers:

DevTeach Montreal: Family Atmosphere, Top Speakers, Lots of Freebies

Techie conferences have different styles, and one of my favourites is DevTeach. Run by my MVP colleague Jean-Rene Roy ("JR"), DevTeach has a welcoming, family atmosphere. DevTeach Montreal (from December 1-5) is professionally-run and offers top-notch technical content (in English) in a fabulous bilingual city.

My seven years as a journalist for Montreal radio stations CJAD and CJFM taught me how the latin heritage of French-Canadians contributes a large measure of warmth and joie de vivre to everything they do. The great thing is that you can experience this feeling without leaving North America.

Right now, JR is offering some price discounts and a nice load of freebies. For example, you'll get $1000 worth of software (Visual Studio 2008 Professional, Expression Web 2 and the Tech-Ed Conference DVD Set). If you're attending TechDays Canada, you can knock $350 off the conference price. Also check for a special for Canadian user group members.

BTW, JR provides free wireless Internet access at his conferences so you don't need to be out of touch with the office during the sessions.

More Posts

Search

Go

This Blog

Web Links

Syndication