Parameter values need to be passed in as an array of objects to the Database.Execute method, not an array of strings (which will be viewed as one object). You need to convert your array of strings (created by the Split method) to an array of objects, which
is easily achieved:
var dataItem = dataLine.Split(delimiterChar).Select(value => (object)value).ToArray();
Mikesdotnett...
All-Star
154852 Points
19855 Posts
Moderator
MVP
Re: An SqlCeParameter with ParameterName '1' is not contained by this SqlCeParameterCollection
May 03, 2012 06:41 AM|LINK
Parameter values need to be passed in as an array of objects to the Database.Execute method, not an array of strings (which will be viewed as one object). You need to convert your array of strings (created by the Split method) to an array of objects, which is easily achieved:
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter