Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Admin/PatientAuto1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PatientAuto1.aspx.cs" Inherits="Admin_PatientAuto1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp"%>





<title>




<asp:scriptmanager id="ScriptManager1" runat="server" enablepagemethods="true">

<asp:autocompleteextender enabled="true" servicemethod="GetSearch" minimumprefixlength="4" completioninterval="10"
="" enablecaching="true" completionsetcount="10" targetcontrolid="TextBox1" id="AutoCompleteExtender1" runat="server" firstrowselected="false">
<asp:label id="Label1" runat="server" text="Search Name">
<asp:textbox id="TextBox1" runat="server">






Admin/PatientAuto1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Services;


public partial class Admin_PatientAuto1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
[WebMethod]
public static List<string> GetSearch(string term)
{
List<string> listPatientNames = new List<string>();

string cs = ConfigurationManager.ConnectionStrings["CredenceDBConn"].ConnectionString;
using (SqlConnection con = new SqlConnection(cs))
{
SqlCommand cmd = new SqlCommand("[dbo].[spGetPatientNames_Vamsi]", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter()
{
ParameterName = "@term",
Value = term
});
con.Open();
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
listPatientNames.Add(rdr["PatientName"].ToString());
}
}

return listPatientNames;
}
}

What I have tried:

service method is not firing ,tried using script service
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900