You'll recall that on Tuesday I reported that there is a bug in the generated connection string when working with a SQL Mobile database in VB.NET. I turns out that there is a bug but it is not specific to VB.NET.
The bug in the generated connection string occurs anytime you add a reference to a table that is a keyword in the programming language you're using. Because the specific database files we were using were all related to real estate based examples, they all contained a table named "property". Of course "property" is a keyword in VB.NET but not C#. Had we had a table whose name was a C# keyword, we would've seen the same problem in the C# project.
So to summarize…
Bug: When referring to tables contained in a SQL Mobile database, Visual Studio 2005 incorrectly sets the connection string in the generated table adapter-derived class when the generated table adapter-derived class refers to a table whose name is a keyword in the current project's language (C# or VB.NET).
Work-around: If possible, change the name of the table to a non-keyword. If for business or legacy reasons you are not able to change the problematic table's name, manually set the connection and connection string as shown in Tuesday's blog post.
Posted
Mar 23 2006, 09:42 AM
by
jim-wilson