<asp:SqlDataSource ID="SqlDataSourceForAutoComplete" runat="server" ConnectionString="<%$ ConnectionStrings:defaultDatabase %>" > </asp:SqlDataSource>
SqlDataSource1.SelectCommand = @"SELECT [ID], [Phone], [FirstName], [LastName] FROM (select [ID], [Phone], [FirstName], [LastName], row_number()over(order by t.[LastName]) as [rn] from [Persons] as t where (([FirstName] + ' ' + [LastName] + ' ' + [Phone]) LIKE @filter)) as st where st.[rn] between @startIndex and @endIndex"; SqlDataSource1.SelectParameters.Clear(); SqlDataSource1.SelectParameters.Add("filter", TypeCode.String, string.Format("%{0}%", e.Filter)); SqlDataSource1.SelectParameters.Add("startIndex", TypeCode.Int64, (e.BeginIndex + 1).ToString()); SqlDataSource1.SelectParameters.Add("endIndex", TypeCode.Int64, (e.EndIndex + 1).ToString()); comboBox.DataSource = SqlDataSource1; comboBox.DataBind();