Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. AutoComplete Extender in VS 2008

AutoComplete Extender in VS 2008

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasehtmlasp-netvisual-studio
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Thanusree Duth
    wrote on last edited by
    #1

    Hi, AutoComplete Extender (using ajax autocompleteextender) is not working fine in VS2008 asp.net web application project.Database I used is MS Access 2007 Here is my code: using System; using System.Collections; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq; using System.Data; using System.Data.OleDb; /// <summary> /// Summary description for MyWebService /// </summary> [WebService(Namespace = "http://microsoft.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. //[System.Web.Script.Services.ScriptMethod] [System.Web.Script.Services.ScriptService] public class MyWebService : System.Web.Services.WebService { public MyWebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] [System.Web.Script.Services.ScriptMethod] public string[] GetCountryInfo(string prefixText) { int count = 10; string sql = "Select * from Country Where Country_Name like @prefixText"; OleDbDataAdapter da = new OleDbDataAdapter(sql, "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/Documents and Settings/Leeds_Desk2/My Documents/trials.accdb"); da.SelectCommand.Parameters.Add("@prefixText", OleDbType.VarChar, 50).Value = prefixText + "%"; DataTable dt = new DataTable(); da.Fill(dt); string[] items = new string[dt.Rows.Count]; int i = 0; foreach (DataRow dr in dt.Rows) { items.SetValue(dr["Country_Name"].ToString(), i); i++; } return items; } } ASPX File ------------- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> <asp:Button ID="Button1" runat="server" Tex

    N R 2 Replies Last reply
    0
    • T Thanusree Duth

      Hi, AutoComplete Extender (using ajax autocompleteextender) is not working fine in VS2008 asp.net web application project.Database I used is MS Access 2007 Here is my code: using System; using System.Collections; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq; using System.Data; using System.Data.OleDb; /// <summary> /// Summary description for MyWebService /// </summary> [WebService(Namespace = "http://microsoft.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. //[System.Web.Script.Services.ScriptMethod] [System.Web.Script.Services.ScriptService] public class MyWebService : System.Web.Services.WebService { public MyWebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] [System.Web.Script.Services.ScriptMethod] public string[] GetCountryInfo(string prefixText) { int count = 10; string sql = "Select * from Country Where Country_Name like @prefixText"; OleDbDataAdapter da = new OleDbDataAdapter(sql, "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/Documents and Settings/Leeds_Desk2/My Documents/trials.accdb"); da.SelectCommand.Parameters.Add("@prefixText", OleDbType.VarChar, 50).Value = prefixText + "%"; DataTable dt = new DataTable(); da.Fill(dt); string[] items = new string[dt.Rows.Count]; int i = 0; foreach (DataRow dr in dt.Rows) { items.SetValue(dr["Country_Name"].ToString(), i); i++; } return items; } } ASPX File ------------- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> <asp:Button ID="Button1" runat="server" Tex

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      If you are going to post code use pre tags, look at the "code block" menu item on the toolbar above the textbox where you entered your question. Also make sure you read the forum guidelines. Have you debugged your application? Which part is not working? The extender? The database call?


      I know the language. I've read a book. - _Madmatt

      1 Reply Last reply
      0
      • T Thanusree Duth

        Hi, AutoComplete Extender (using ajax autocompleteextender) is not working fine in VS2008 asp.net web application project.Database I used is MS Access 2007 Here is my code: using System; using System.Collections; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq; using System.Data; using System.Data.OleDb; /// <summary> /// Summary description for MyWebService /// </summary> [WebService(Namespace = "http://microsoft.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. //[System.Web.Script.Services.ScriptMethod] [System.Web.Script.Services.ScriptService] public class MyWebService : System.Web.Services.WebService { public MyWebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] [System.Web.Script.Services.ScriptMethod] public string[] GetCountryInfo(string prefixText) { int count = 10; string sql = "Select * from Country Where Country_Name like @prefixText"; OleDbDataAdapter da = new OleDbDataAdapter(sql, "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:/Documents and Settings/Leeds_Desk2/My Documents/trials.accdb"); da.SelectCommand.Parameters.Add("@prefixText", OleDbType.VarChar, 50).Value = prefixText + "%"; DataTable dt = new DataTable(); da.Fill(dt); string[] items = new string[dt.Rows.Count]; int i = 0; foreach (DataRow dr in dt.Rows) { items.SetValue(dr["Country_Name"].ToString(), i); i++; } return items; } } ASPX File ------------- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox> <asp:Button ID="Button1" runat="server" Tex

        R Offline
        R Offline
        raju melveetilpurayil
        wrote on last edited by
        #3

        Check these links AutoComplete Demonstration[^] AutoComplete From Database[^] Ajax AutoComplete in ASP.NET[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups