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;
-
-
- }