예제 #1
0
        private void ShowDataCRF3c()
        {
            MySqlConnection con = new MySqlConnection(constr);

            try
            {
                con.Open();
                MySqlCommand cmd;
                cmd = new MySqlCommand("select form_crf_3c_id,study_code, lw_crf3c_2 as DOV, q6 as woman_nm, q7 as husband_nm,dssid, lw_crf3c_15 as ch_weight, lw_crf3c_17 as ch_length, lw_crf3c_19 as ch_muac, lw_crf3c_21 as ch_ofhc  from view_crf3c where dssid  like '" + txtdssidCRF3c.Text.ToUpper() + "%'", con);
                MySqlDataAdapter sda = new MySqlDataAdapter();
                {
                    cmd.Connection     = con;
                    cmd.CommandTimeout = 9999999;
                    sda.SelectCommand  = cmd;
                    DataTable dt = new DataTable();
                    {
                        sda.Fill(dt);
                        GridViewCRF3c.DataSource = dt;
                        GridViewCRF3c.DataBind();
                        con.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + ex.Message + "')</script>");
            }
            finally
            {
                con.Close();
            }
        }
예제 #2
0
        private void ShowDataCRF3c()
        {
            MySqlConnection con = new MySqlConnection(constr);

            try
            {
                con.Open();
                MySqlCommand cmd;
                cmd = new MySqlCommand("select * from view_crf3c where dssid  like '" + txtdssidCRF3c.Text.ToUpper() + "%'", con);
                MySqlDataAdapter sda = new MySqlDataAdapter();
                {
                    cmd.Connection     = con;
                    cmd.CommandTimeout = 9999999;
                    sda.SelectCommand  = cmd;
                    DataTable dt = new DataTable();
                    {
                        sda.Fill(dt);
                        GridViewCRF3c.DataSource = dt;
                        GridViewCRF3c.DataBind();
                        con.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                Response.Write("<script type=\"text/javascript\">alert('" + ex.Message + "')</script>");
            }
            finally
            {
                con.Close();
            }
        }