Ben,
I was out of the office all morning at a branch location....
The problem is that when you are building the where clause you are looping through the controls and passing the control's counter position to the BuildWhereElement function whch then looks at the adjusted fields collection.
However the count does not nessasarily reflect the search fields proper position in the adjusted fields collection if there are non visible fields.
As you can see the on second Select Statement the where clause is built with the wrong field. Hope that makes sense.
1 |
2007-07-26 14:34:51.933 |
General Command Settings |
Text |
System.Data.SqlClient.SqlCommand |
Data Source=ares;Initial Catalog=StrataFrameSample;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True |
False |
Command Settings |
SELECT TOP 1000 [cust_pk], [cust_Company], [cust_Prefix], [cust_FirstName], [cust_MiddleName], [cust_LastName], [cust_Suffix], [cust_Address1], [cust_Address2], [cust_City], [cust_State], [cust_Postal], [cust_Country], [cust_Email], [cust_PhoneDay], [cust_PhoneDayType], [cust_PhoneNight], [cust_PhoneNightType], [cust_Created], [cust_Version] FROM [dbo].[Customers] WHERE [cust_PhoneDayType] = @PARAM0; |
Command Parameters |
'1' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: | SourceVersion: Current] |
2 |
2007-07-26 14:35:02.292 |
General Command Settings |
Text |
System.Data.SqlClient.SqlCommand |
Data Source=ares;Initial Catalog=StrataFrameSample;Integrated Security=True;Persist Security Info=False;Asynchronous Processing=True |
False |
Command Settings |
SELECT TOP 1000 [cust_pk], [cust_Company], [cust_Prefix], [cust_FirstName], [cust_MiddleName], [cust_LastName], [cust_Suffix], [cust_Address1], [cust_Address2], [cust_City], [cust_State], [cust_Postal], [cust_Country], [cust_Email], [cust_PhoneDay], [cust_PhoneDayType], [cust_PhoneNight], [cust_PhoneNightType], [cust_Created], [cust_Version] FROM [dbo].[Customers] WHERE [cust_LastName] LIKE @PARAM0; |
Command Parameters |
'2%' [DbType: String | Size: 60 | Direction: Input | SourceColumn: | SourceVersion: Current] |