Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

How do I add this condition to the selection sentence

$
0
0

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 Sentence

and doctors.city_no = '"+DropDownList5.SelectedValue +"'

How can I do it

Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>