hi
How do I change datafield value for gridview column from button click.
For the same gridview If the condition is met, the first select statement will be executed, which will show the count the visits and If the condition is not met, the second select sentence will be executed, which will show the date of visits
if (!string.IsNullOrEmpty(DropDownList1.Text))//اذاكان الحقل اسم المندوب غير فارغ
{
OracleDataAdapter da = new OracleDataAdapter("SELECT DAILY_DO.DOC_NO, DOCTORS.DOC_NAME, count(daily_do.doc_no)as count FROM DAILY_DO, DOCTORS WHERE(DAILY_DO.DOC_NO = DOCTORS.DOC_NO)and (daily_do.man_NO = '" + lblman_no.Text + "') and daily_do.date_ee between TO_DATE('" + txtfromdate.Text + "12:00:00','YYYY-MM-DD HH:MI:ss') and TO_DATE('" + txttodate.Text + "12:00:00','YYYY-MM-DD HH:MI:ss') group by DAILY_DO.DOC_NO, DOCTORS.DOC_NAME order by count desc", connect);
DataSet ds = new DataSet();
connect.Close();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
GridView1.Columns[0].Visible = false;//هذا السطر لعدم عرض العمود الاول في الجريد فيو وهو حق رقم الطبيب
}
else //الشرط الاول كان مسجل الدخول هو المشرف سيضهر معه اسماء المندوبين اما في حالة من سجل الدخول مندوب فسياخذ هنا رقم المندوب بن ليبل رقم المندوب
{
OracleDataAdapter da = new OracleDataAdapter("SELECT DAILY_DO.DOC_NO, DAILY_DO.DATE_EE, DOCTORS.DOC_NAME FROM DAILY_DO, DOCTORS WHERE DAILY_DO.DOC_NO = DOCTORS.DOC_NO and daily_do.man_no = '" + lblman_no.Text + "' and daily_do.doc_no = '" + hfdoc_no.Value + "' and daily_do.date_ee between TO_DATE('" + txtfromdate.Text + "12:00:00','YYYY-MM-DD HH:MI:ss') and TO_DATE('" + txttodate.Text + "12:00:00','YYYY-MM-DD HH:MI:ss')", connect);
DataSet ds = new DataSet();
connect.Close();
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
GridView1.Columns[0].Visible = false;//هذا السطر لعدم عرض العمود الاول في الجريد فيو وهو حق رقم الطبيب
}