My Code
This Part Working Properly
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Services;
- using System.Data.SqlClient;
- using System.Configuration;
- using System.Web.Script.Services;
- namespace Product
- {
- ///
- /// Summary description for CustService
- ///
- [WebService(Namespace = "http://tempuri.org/")]
- [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- [System.ComponentModel.ToolboxItem(false)]
- // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
- [System.Web.Script.Services.ScriptService]
- public class CustService : System.Web.Services.WebService
- {
- [WebMethod]
- [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
- public List<string> GetAutoCompleteData(string name)
- {
- List<string> result = new List<string>();
- using (SqlConnection con = new SqlConnection(@"Data Source=KARUKUVELRAJ-PC\SQLEXPRESS;Initial Catalog=Product;Integrated Security=True"))
- {
- using (SqlCommand cmd = new SqlCommand("select DISTINCT name from customer where name LIKE '%'+@SearchText+'%'", con))
- {
- con.Open();
- cmd.Parameters.AddWithValue("@SearchText", name);
- SqlDataReader dr = cmd.ExecuteReader();
- while (dr.Read())
- {
- result.Add(dr["name"].ToString());
- }
- return result;
- }
- }
- }
- }
- }
I Run This Code Not invoke it not Response, How to Clear this Problem
Ashutosh GuptaPosted Dec 18, 2019, 12:07 PM
Salman BegPosted Dec 18, 2019, 9:26 AM
dhoni kholiPosted Dec 18, 2019, 9:03 AM
Salman BegPosted Dec 18, 2019, 8:08 AM