I'm new to this in C # and I have this project which asked me that they no longer want to show the data in a table, they just want a message that says "that person is found" and if your rfc is not in that one Base says 'person is not in this area'
protected void btnBuscador_Click(object sender, EventArgs e)
{
string rfcTxt = txtBuscador.Text.Trim();
rfcTxt.Length.ToString();
string nameTxt = txtBuscador2.Text;
CV_ver.Visible = true;
if (rbRFC.Checked == false)
{
}
else if (rfcTxt.Length < 11)
{
LblBus.Visible = true;
LblBus.Text = "El campo RFC debe contener 12 ó 13 caracteres.";
CV_ver.Visible = false;
}
else
{
SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnectionDate"].ConnectionString);
SqlCommand cmd = new SqlCommand("consultarRFC_2", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter p1 = new SqlParameter("rfc", rfcTxt);
cmd.Parameters.Add(p1);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
CV_ver.DataSource = dt;
CV_ver.DataBind();
}