hi all
I have a textbox contain AutoComplete Ajax
And I have this code that contains the select claus[WebMethod]
[System.Web.Script.Services.ScriptMethod()]
public static List<string> GetCompletionList(string prefixText, int count)
{
return AutoFillProducts(prefixText);
}
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
private static List<string> AutoFillProducts(string prefixText)
{
using (OracleConnection con = new OracleConnection("data source=localhost:1521/orcl; user id=aaaaaaa; password=1111111;"))
{
using (OracleCommand com = new OracleCommand())
{
com.CommandText = "select doc_no, doc_name from doctors where doctors.doc_name like '%" + prefixText + "%' ";
com.Parameters.Add("@TextBox1", prefixText);
com.Connection = con;
con.Open();
List<string> summ = new List<string>();
using (OracleDataReader sdr = com.ExecuteReader())
{
while (sdr.Read())
{
summ.Add(string.Format("{0}-{1}", sdr["DOC_NAME"], sdr["Doc_NO"]));
}
}
con.Close();
return summ;
}
}
}
I want to add this condition to the select Sentenceand doctors.city_no = '"+DropDownList5.SelectedValue +"'
How can I do it