<asp:TextBox ID="txt_vech_no" runat="server"></asp:TextBox> <cc1:AutoCompleteExtender ID="AutoCompleteExtender4" runat="server" TargetControlID="txt_vech_no" MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="0" ServiceMethod="get_vehicleno"></cc1:AutoCompleteExtender>
[System.Web.Script.Services.ScriptMethod()] [System.Web.Services.WebMethod] public static List<string> get_vehicleno(string prefixText) { SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["BMS"].ToString()); con.Open(); SqlCommand cmd15 = new SqlCommand("select * from tbl_vehicle where vehicle_registration_no like @Name+'%'", con); cmd15.Parameters.AddWithValue("@Name", prefixText); SqlDataAdapter da15 = new SqlDataAdapter(cmd15); DataTable dt15 = new DataTable(); da15.Fill(dt15); List<string> CountryNames12 = new List<string>(); for (int i = 0; i < dt15.Rows.Count; i++) { CountryNames12.Add(dt15.Rows[i][1].ToString()); } return CountryNames12; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)