<%@ WebHandler Language="C#" Class="Search_Auto" %>
using System;
using System.Web;
using System.Data.OracleClient;
using System.Configuration;
using System.Text;
public class Search_Auto : IHttpHandler {
public void ProcessRequest (HttpContext context) {
string prefixText = context.Request.QueryString["q"];
using (OracleConnection conn = new OracleConnection())
{
conn.ConnectionString = ConfigurationManager
.ConnectionStrings["Oracle_Itech"].ConnectionString;
//conn = WebConfigurationManager.ConnectionStrings["Oracle_Itech"].ConnectionString;
using (OracleCommand cmd = new OracleCommand())
{
cmd.CommandText = "select xaccdesc from plmster where " +
"xaccdesc like @TextBox2 + '%'";
cmd.Parameters.AddWithValue("@TextBox2", prefixText);
cmd.Connection = conn;
StringBuilder sb = new StringBuilder();
conn.Open();
using (OracleDataReader sdr = cmd.ExecuteReader())
{
while (sdr.Read())
{
sb.Append(sdr["xaccdesc"])
.Append(Environment.NewLine);
}
}
conn.Close();
context.Response.Write(sb.ToString());
}
}
}
public bool IsReusable {
get {
return false;
}
}
}
i use this link
http://www.aspsnippets.com/Articles/Using-jQuery-AutoComplete-Plugin-in-ASP.Net.aspx
error is here
using (OracleDataReader sdr = cmd.ExecuteReader())