TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Subin Thomas
NA
4.9k
127.2k
autocomplete extender how does it work
Feb 24 2019 11:39 PM
i have have taken project name and project code in a autocomplete textbox the code is given below when i type name it comes with respective code , i want to know how what is assigned in that textbox name or code because i want to give further function for code only
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public
static
List<string> GetSearch(string prefixText)
{
DataTable dt =
new
DataTable();
SqlConnection con =
new
SqlConnection(con_Vas);
SqlCommand cmd =
new
SqlCommand(
"SELECT [Employee Name]+'; '+[Employee Code] as Name FROM [HRPLK].[dbo].[View_EmployeeBasicInformation] where [Employee Name] like '%'+ @EmpName +'%' "
);
cmd.Parameters.AddWithValue(
"@EmpName"
, prefixText);
cmd.Connection = con;
con.Open();
List<string> employees =
new
List<string>();
using
(SqlDataReader sdr = cmd.ExecuteReader())
{
while
(sdr.Read())
{
employees.Add(sdr[
"Employee Code"
].ToString());
}
}
con.Close();
return
employees;
}
Reply
Answers (
11
)
How can I make a payment page in my payment system ?
Crystal Report and asp.net C#