2
I’m having trouble understanding how to bring a query from textbox
of a column where the field is decimal?
if (txtNomePesquisar.Text.Equals(""))
{
MessageBox.Show("O que você procura? ");
}
else
{
var clientes = cc
.TB_CLIENTEs.Where(c => c.NOM_CLIENTE.Contains(txtNomePesquisar.Text)).ToList();
dgvCliente.DataSource = clientes;
}
if (txtTelPesquisar.Text.Equals(""))
{
/// a mensagem é 'decimal' does contain a definition for (Contains) and...
/// e fala de IQueryable mais não sei utilizar ainda
///
var clientes = cc.TB_CLIENTEs
.Where(c => c.TEL_CLIENTE.Contains(txtTelPesquisa.Text)).ToList();
}
which field is decimal?
– novic
var clients = cc.Tb_clients . Where(c => c.TEL_CLIENTE.Contains(txtTelPesquisa.Text)). Tolist();
– Jameson
this is the decimal field TEL_CLIENTE
– Jameson
So I made an answer, see if that’s what you need?
– novic
Thank you, I’m trying because when I search with this code it does not bring value more if I type the number 1 it brings the record that has only the number 1 those that has more than one number for example : 44334, it does not bring results there I am checking what can be.
– Jameson
What do you need?
– novic
what I’m having difficulty is I have 2 search fields when I click the search button it can bring the list by NAME or PHONE in SQL I know how to do more in C# I’m not getting the way I can bring the NAME was as the code above is and I separated the PHONE because I couldn’t put it together. What I need is to bring the list either with the PHONE or NAME when clicked on the SEARCH button... I’m almost changed the data type of the phone field to scan if I can’t.
– Jameson
Phone is good to be in varchar friend... if put decimal in my opinion have a future mistake.
– novic
I figured I’ll do it myself since it’s so complicated. Thanks for the help.
– Jameson