Hi All
I have an autocomplete list that shows the (doc_no, doc_name)
Now I just want to insert the doc_no and leave the doc_name
I used this code
("insert into daily_do (MAN_NO,date_ee,DOC_NO,TIME_V,DA_NO,fail_vis) VALUES ('" + lblman_no.Text + "', to_date('" + txtdate.Text + "12:00:00','YYYY-MM-DD HH:MI:ss') ,'" + textbox1.text + "','" + DropDownList1.SelectedValue + "',(select max(DA_NO) from daily_do)+1,'" + DropDownList2.SelectedValue + "')", connect);
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static List<string> GetCompletionList(string prefixText, int count)
{
using (OracleConnection con = new OracleConnection("data source=localhost:1521/orcl; user id=alhakimy; password=alhakimyyes;"))
{
using (OracleCommand com = new OracleCommand())
{
com.CommandText = "select doc_no, doc_name from doctors where city_no= Session['city_no'] and 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;
}
}
}