Hi Every one,
Iam New Software Developer i write One Logic code But I got Small and simple Error where iam doing Wrong Find out Me And Modified my source code in the Below the My Source Code..
public void chkStatus_OnCheckedChanged(object sender, EventArgs e)
{
CheckBox chkStatus = (CheckBox)sender;
GridViewRow row = (GridViewRow)chkStatus.NamingContainer;
string UserName = row.Cells[5].ToString();
bool ApproveStatus = chkStatus.Checked;
string constr = @"Data Source=SERVER;Initial Catalog=MuraliIIT;User ID=sa;Password=rits@1234";
string query = "UPDATENewStudentRegistrationForm SET ApproveStstus = @ApprovedStatus WHERE UserName = @UserName";
SqlConnection con = new SqlConnection(constr);
SqlCommand com = new SqlCommand(query, con);
com.Parameters.Add("@ApproveStatus", SqlDbType.Bit).Value = ApproveStatus;
com.Parameters.Add("@UserName", SqlDbType.Char).Value = Convert.ToInt32(UserName);
con.Open();
com.ExecuteNonQuery();
con.Close();
Thanks &Regards,
subbareddy.

Guest UserPosted May 26, 2015, 6:18 AM
Guest UserPosted May 26, 2015, 6:44 AM
Venkata SubbareddyPosted May 26, 2015, 6:42 AM
Guest UserPosted May 26, 2015, 6:38 AM
Venkata SubbareddyPosted May 26, 2015, 6:35 AM
Guest UserPosted May 26, 2015, 6:28 AM
Venkata SubbareddyPosted May 26, 2015, 6:26 AM
Guest UserPosted May 26, 2015, 6:24 AM
Venkata SubbareddyPosted May 26, 2015, 6:22 AM
Must declare the scalar variable "@ApprovedStatus".
Venkata SubbareddyPosted May 26, 2015, 6:13 AM
Guest UserPosted May 26, 2015, 6:08 AM
Venkata SubbareddyPosted May 26, 2015, 6:06 AM
Guest UserPosted May 26, 2015, 6:00 AM
Venkata SubbareddyPosted May 26, 2015, 5:59 AM
Guest UserPosted May 26, 2015, 5:56 AM
Venkata SubbareddyPosted May 26, 2015, 5:55 AM
Guest UserPosted May 26, 2015, 5:46 AM