Sir I am having a page web4.aspx
it has a text field
the value of this text field i am passing to default2.aspx using QUERY STRING
In default2.aspx i am trying to update a row
after the execution no error is coming
but the row is not getting updated
below is my code /
/default2.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
public partial class Default2 : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
Label1.Text = Request.QueryString["s"].ToString();
}
else if (RadioButton3.Checked )
{
string z = "Voted";
SqlCommand cmd2 = new SqlCommand("UPDATE [users] SET [Address] ='" + z + "' WHERE [ElectionId] =" + "'Label1.Text '", con);
cmd2.ExecuteNonQuery();
con.Close();
}
}
}