Hi
i need to retrive by c# coding only and also i did not use grdiview.Just i want to select the value and want to display the aspx page.I try the coding below mention .
protected void btnSerch_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "SelectItems";
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
con.Open();
cmd.Parameters.Add("@Id", SqlDbType.Int).Value = txtId.Text;
SqlDataReader dr = cmd.ExecuteReader();
dr.Read();
txtName.Text = dr["UserName"].ToString();
if (dr["Male"].ToString() == "true")
{
rbMale.Checked = true;
}
else
{
rbFemale.Checked = false;
}
//cmd.ExecuteNonQuery();
con.Close();
}
}
But in this code if condition not work properly kindly modify it
Thanks
Gokulakrishnan
Gokularts2006, if this helps please login to Mark As Answer. | Alert Moderator