update not working
<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    txtHidden.Text = Request.QueryString["YKcode"];
    Display();
}

private void Display()
{
    SqlDataReader reader;
    SqlConnection con = new SqlConnection("Data Source=Localhost;Initial Catalog=MLC000022;User ID=sa;Password=Adama6DaY; Integrated Security=True");
    SqlCommand cmd = new SqlCommand("SELECT " + "  dbo.GMYAKU.NAME, " +"FROM " +
                                    "  dbo.GMYAKU " + "   WHERE " +
                                    "  (dbo.GMYAKU.YKCODE = ('" + txtHidden.Text + "'))",con) ;    
    con.Open();
    reader = cmd.ExecuteReader();
    if (reader.Read())
    {
        this.TextBox1.Text = reader["NAME"].ToString();
    }
    else
    {      
        // 読めないので画面を初期化する
     }

    cmd.Connection.Close();
    cmd.Dispose();
    con.Close();
}

protected void Button1_Click(object sender, EventArgs e)
{
    string connetionString = null;
    SqlConnection cnn;
    SqlCommand cmd;

    connetionString = ("Data Source=Localhost;Initial Catalog=MLC000022;User ID=sa;Password=redacted; Integrated Security=True");

    string strSQL ;
    strSQL = "UPDATE GMYAKU SET";
    strSQL += " NAME = '" + (TextBox1.Text) + "'";
    strSQL += " WHERE";
    strSQL += " YKCODE= '" + txtHidden.Text + "'";
    cnn = new SqlConnection(connetionString);
    try
    {
        cnn.Open();
        cmd = new SqlCommand(strSQL, cnn);
        cmd.ExecuteNonQuery();
        cmd.Dispose();
        // cnn.Close();
        //MessageBox.Show(" ExecuteNonQuery in SqlCommand executed !!");
    }
    catch (Exception ex)
    {
        // MessageBox.Show("Can not open connection ! ");
    }

    Response.Redirect("Default.aspx");
 }
</code></pre>
