Re: SQL Compact Edition does not recognize parameter
- From: "Ginny Caughey MVP" <ginny.caughey.online@xxxxxxxxxxxxxx>
- Date: Fri, 9 May 2008 09:51:36 -0400
I haven't run into this problem, I wonder if you can reproduce it yourself? If so, you might try looking in the debugger to see what the parameters collection looks like before you execute the query. Sometimes I have found, also with SQL Server, that I'll get a missing parameter message when in fact it just has a data type different than what I intend.
Ginny
<d.wiss@xxxxxxx> wrote in message news:7457a72a-8009-4aac-82de-3dd3a2832d7f@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
--
Ginny Caughey
Device Application Development MVP
www.wasteworks.com
Software for Waste Management
.
- Follow-Ups:
- Re: SQL Compact Edition does not recognize parameter
- From: d . wiss
- Re: SQL Compact Edition does not recognize parameter
- References:
- SQL Compact Edition does not recognize parameter
- From: d . wiss
- SQL Compact Edition does not recognize parameter
- Prev by Date: SQL Compact Edition does not recognize parameter
- Next by Date: Re: SQL Compact Edition does not recognize parameter
- Previous by thread: SQL Compact Edition does not recognize parameter
- Next by thread: Re: SQL Compact Edition does not recognize parameter
- Index(es):
Relevant Pages
|