Good morning: Peace with everyone ...
Error Searching in textbox is not controlled FromException, Input string was not in a correct format.
the folio is numeric type, when searching in my textbox if it does, but when you remove everything you write in the textbox, you mark that error, could someone tell me a solution ???
private void txtBusqueda_TextChanged(object sender, System.EventArgs e){
if ((txtBusqueda.Text) != null){
conexSQL.Open();
SqlCommand cmd = new SqlCommand("select * from _producto where folio=@folio", conexSQL);
cmd.Parameters.Add("@folio", SqlDbType.Int).Value = Convert.ToInt32 (txtBusqueda.Text);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read()){
cmbNom.Text = dr["nombre"].ToString();
cmbDes.Text = dr["descripcion"].ToString();
}
else{
}
dr.Close();
conexSQL.Close();
}
}