CREATE TABLE [dbo].[Skills](
[SkillID] [bigint] NOT ,
[Skills] [nvarchar](max)
) ON [PRIMARY]
Fill some data in this table.<asp:TextBox ID="txtTags" runat="server" Font-Bold="True" Width="100%" ></asp:TextBox>
<asp:AutoCompleteExtender ServiceMethod="GetSkills" MinimumPrefixLength="1" CompletionInterval="100" EnableCaching="false" CompletionSetCount="1" TargetControlID="txtTags" ID="AutoCompleteExtender1" runat="server" FirstRowSelected="True" ShowOnlyCurrentWordInCompletionListItem="true"></asp:AutoCompleteExtender>
[System.Web.Script.Services.ScriptMethod()] [System.Web.Services.WebMethod] public static List<string> GetSkills(string prefixText, int count) { SqlConnection conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["BlogTest"].ToString()); SqlCommand com = new SqlCommand("select skills from skills where skills LIKE ''+@SearchText+'%'", conn); com.Parameters.AddWithValue("@SearchText", prefixText); conn.Open(); List<string> Tags = new List<string>(); using (SqlDataReader sdr = com.ExecuteReader()) { while (sdr.Read()) { Tags.Add(sdr["skills"].ToString()); } } conn.Close(); return Tags; }