Resources for IT Professionals >
포럼 홈
>
SharePoint - Business Data Catalog (pre-SharePoint 2010)
>
Wildcard FilterDescriptor
Wildcard FilterDescriptor
- I added a couple filters to my BDC but am not having much luck getting the wildcard FilterDescriptor to work. When I perform a search, 'is equal to' is the search that will return any results. 'starts with,' 'ends with' and 'contains' all return no results no matter what I search for. Any idea what I'm missing??? Below is the Finder method I'm using. Thanks!
<Method Name="GetEmployee"> <Properties> <Property Name="RdbCommandType" Type="System.Data.CommandType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">Text</Property> <Property Name="RdbCommandText" Type="System.String"> SELECT [EmployeeID] ,[FirstName] + ' ' + [LastName] as Name ,[FirstName] ,[LastName] FROM [ITDEmployee].[dbo].[tblEmployee] where [LastName] like @LastName and [FirstName] like @FirstName </Property> </Properties> <FilterDescriptors> <FilterDescriptor Type="Wildcard" Name="Last Name"> <Properties> <Property Name="UsedForDisambiguation" Type="System.Boolean" >true</Property> </Properties> </FilterDescriptor> <FilterDescriptor Type="Wildcard" Name="First Name"> <Properties> <Property Name="UsedForDisambiguation" Type="System.Boolean" >true</Property> </Properties> </FilterDescriptor> </FilterDescriptors> <Parameters> <Parameter Direction="In" Name="@LastName"> <TypeDescriptor TypeName="System.String" Name="LastName" AssociatedFilter="Last Name"> <DefaultValues> <DefaultValue MethodInstanceName="GetEmployeeFinder_Instance" Type="System.String">%</DefaultValue> </DefaultValues> </TypeDescriptor> </Parameter> <Parameter Direction="In" Name="@FirstName"> <TypeDescriptor TypeName="System.String" Name="FirstName" AssociatedFilter="First Name"> <DefaultValues> <DefaultValue MethodInstanceName="GetEmployeeFinder_Instance" Type="System.String">%</DefaultValue> </DefaultValues> </TypeDescriptor> </Parameter> <Parameter Direction="Return" Name="@Employee"> <TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Reader"> <TypeDescriptors> <TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="Record"> <TypeDescriptors> <TypeDescriptor TypeName="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IdentifierName="EmployeeID" Name="EmployeeID" /> <TypeDescriptor TypeName="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="Name" /> <TypeDescriptor TypeName="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="FirstName" /> <TypeDescriptor TypeName="System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="LastName" /> </TypeDescriptors> </TypeDescriptor> </TypeDescriptors> </TypeDescriptor> </Parameter> </Parameters> <MethodInstances> <MethodInstance Type="Finder" ReturnParameterName="@Employee" ReturnTypeDescriptorName="Reader" ReturnTypeDescriptorLevel="0" Name="GetEmployeeFinder_Instance" /> </MethodInstances> </Method>
답변
- I was able to figure out the problem. Sharepoint is sending an * as the wildcard character and my database was not recognizing it as such. In my SPROC, I used the replace function to replace the * with % and now it works. Hopefully this saves someone else some time.
- 답변으로 표시됨trmiller83 2009년 12월 3일 목요일 오후 8:59
모든 응답
- I was able to figure out the problem. Sharepoint is sending an * as the wildcard character and my database was not recognizing it as such. In my SPROC, I used the replace function to replace the * with % and now it works. Hopefully this saves someone else some time.
- 답변으로 표시됨trmiller83 2009년 12월 3일 목요일 오후 8:59
- Hi trmiller83,
That's a good catch. I am sure you've used Profiler to check the query. In case you haven't tried yet, you could also turn on the Verbose log to monitor what's going on behind the hood.
Hope this helps. Mahalo! Wen
Wen He (http://sharepointhawaii.com/WenHe)
Wen