exec sp_executesql N'SELECT * FROM Customers WHERE CustomerID LIKE @P1 ORDER BY CompanyName', N'@P1 nchar(5)', N'M% 'As you can see there're extra spaces in the value of the parameter. I think it's a bug in CA. A workaround may be to use "_" to pad to the lenght of the field.
cCustomerId = [M____]
>...or maybe not a bug, but it is darned puzzling. The database is Northwind in MSDE/SQL Server. The DataSourceType is ADO. The code runs 2 slightly different SelectCMD properties. One returns data the other does not. Yet why one does not is totally baffling. The 2 select SQL are:>SELECT * FROM Customers WHERE CustomerID LIKE ?cCustomerID ; > ORDER BY CompanyName >SELECT * FROM Customers WHERE CompanyName LIKE ?cCompany ; > ORDER BY CompanyName>The first one returns no data. If you create an ODBC connection to the same database and use SPT, the first SQL does return data. The following code will reproduce these results. You may need to modify the ADO Connection String to connect to your Northwind database in MSDE or SQL Server.