SQL Compact Edition does not recognize parameter
- From: d.wiss@xxxxxxx
- Date: Fri, 9 May 2008 05:36:23 -0700 (PDT)
Hi all
I use the following example for the description:
"UPDATE Table SET Column1=@Value1"
In code I create a parameter and add it to a list which is passed to
the execution:
_dbHelper.CreateParameter("@Value1", SqlDbType.NVarChar, 50, "some
text value")
Of course the original table query has more columns and parameter but
it's not necessary to see behind the problem. The query and the
parameters are all written in camel notation.
We are using .NET 2.0, SQL 2005 Compact Edition V3.0.5300.0.
Now the problem:
Our software is installed on tousands of computers, mostly installed
with W2K, XP and recently also Vista.
In Spain we have a problem on several machines and the company there
assured that all computers have the same installation. It's a chain to
selling our products.
On ca. 19 machines (of 50) in different chain shops, if they start our
software it shows following error in the log file:
System.IndexOutOfRangeException
An SqlCeParameter with ParameterName '@himodelleft' is not contained
by this SqlCeParameterCollection.
[System.Data.SqlServerCe]System.Data.SqlServerCe.SqlCeCommand::CompileQueryPlan()
It's always the same error message althought there are 35 parameters
defined in the query and obviously in the provided parameter/value
list. The affected parameter is on index [31] (based on [0]).
This error message tells me that SQLCE lower cases the query text to
"update table set column1=@value1" because the specified parameter
name in the error message is written in lower case.
Therefore I assume that the associated created parameter is converted
to lower case as well.
The following link shows a similar problem but on PDA's with Windows
Mobile installed
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1216930&SiteID=1
Strange are the following two lines:
MODEL SQLCE NETCF O.S. PROBLEM
QTEK S200 3.0.5214.0 2.0.5238.0 WM5 YES
QTEK 9900 3.0.5214.0 2.0.5238.0 WM5 NO
Only the hardware is different but on one PDA the problem exists
whereas on the other it doesn't!
His solution was to lower case all the parameters and the problem was
gone on the QTEK S200 PDA.
In our case I'm not sure if this would help.
Has anybody else faced to this problem? Any help would be appreciated.
Regards
Daniel
.
- Follow-Ups:
- Re: SQL Compact Edition does not recognize parameter
- From: Ginny Caughey MVP
- Re: SQL Compact Edition does not recognize parameter
- Prev by Date: Re: SQL CE 3.5 on CE6
- Next by Date: Re: SQL Compact Edition does not recognize parameter
- Previous by thread: Regarding my network based application
- Next by thread: Re: SQL Compact Edition does not recognize parameter
- Index(es):
Relevant Pages
|