Exemplo n.º 1
0
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string        strConnection = WebConfigurationManager.ConnectionStrings["28dayConnectionString"].ConnectionString.ToString();
        SqlConnection Connection    = new SqlConnection(strConnection);

        Connection.Open();
        String        strSQL   = "Select * From student where s_sno='" + this.GridView1.SelectedDataKey["c_sno"].ToString() + "'";
        String        strSQL1  = "Select * From communist where c_sno='" + this.GridView1.SelectedDataKey["c_sno"].ToString() + "'";
        SqlCommand    command  = new SqlCommand(strSQL, Connection);
        SqlCommand    command1 = new SqlCommand(strSQL1, Connection);
        SqlDataReader Dr;
        SqlDataReader Dr1;

        Dr = command.ExecuteReader();

        while (Dr.Read())
        {
            TextBox3.Text  = Dr["s_name"].ToString();
            TextBox4.Text  = Dr["s_sno"].ToString();
            TextBox5.Text  = Dr["s_sex"].ToString();
            TextBox6.Text  = Dr["s_birthplace"].ToString();
            TextBox7.Text  = Dr["s_ethnic"].ToString();
            TextBox8.Text  = Dr["s_birthplace"].ToString();
            TextBox9.Text  = Dr["s_idcard"].ToString();
            TextBox10.Text = Dr["s_academy"].ToString();
            TextBox11.Text = Dr["s_phone"].ToString();
            TextBox12.Text = Dr["s_email"].ToString();
            //Image1.ImageUrl = ResolveUrl(Dr["out_add1"].ToString());
        }
        Dr.Close();
        Dr1 = command1.ExecuteReader();
        while (Dr1.Read())
        {
            TextBox13.Text = Dr1["c_contactor"].ToString();
            TextBox14.Text = Dr1["c_partytime"].ToString();
            TextBox15.Text = Dr1["c_note"].ToString();
        }
        Dr1.Close();
        Connection.Close();

        /*string content;
         * content = Doc2Text(Server.MapPath("image3/" + this.GridView1.SelectedDataKey["out_fname"].ToString()));
         * Image1 = content;*/
    }
Exemplo n.º 2
0
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string        strConnection = WebConfigurationManager.ConnectionStrings["28dayConnectionString"].ConnectionString.ToString();
        SqlConnection Connection    = new SqlConnection(strConnection);

        Connection.Open();
        String        strSQL   = "Select * From outpeople where out_sno='" + this.GridView1.SelectedDataKey["out_sno"].ToString() + "'";
        String        strSQL1  = "Select * From student where s_sno='" + this.GridView1.SelectedDataKey["out_sno"].ToString() + "'";
        SqlCommand    command  = new SqlCommand(strSQL, Connection);
        SqlCommand    command1 = new SqlCommand(strSQL1, Connection);
        SqlDataReader Dr;
        SqlDataReader Dr1;

        Dr = command.ExecuteReader();

        while (Dr.Read())
        {
            Label1.Text     = Dr["out_sno"].ToString();
            Label2.Text     = Dr["out_iunit"].ToString();
            Label3.Text     = Dr["out_profession"].ToString();
            Label4.Text     = Dr["out_date"].ToString();
            Label5.Text     = Dr["out_graduation"].ToString();
            Image1.ImageUrl = ResolveUrl(Dr["out_add1"].ToString());
        }
        Dr.Close();
        Dr1 = command1.ExecuteReader();
        while (Dr1.Read())
        {
            Label6.Text = Dr1["s_name"].ToString();
        }
        Dr1.Close();
        Connection.Close();

        /*string content;
         * content = Doc2Text(Server.MapPath("image3/" + this.GridView1.SelectedDataKey["out_fname"].ToString()));
         * Image1 = content;*/
    }