Avoid injecting application complexity into sql querys. This makes maintenance difficult, because reusing SQL (strings) is practically 0.
The ideal serial construction of a Cpf object:
public class Cpf{
private string _valorSemMascara;
public string CpfComMascara {
get{
// retorna _valorSemMascara incluindo máscara por concatenação
}
set{
// remove máscara de 'value' e atribui valor em _valorSemMascara
}
}
public string CpfSemMascara {
get{
return _valorSemMascara;
}
set{
_valorSemMascara = value;
}
}
}
This object would be reused in several situations within your system.
You can use it from your 'text_changed' to the point of inclusions, changes and obtainments (selects).
Only in the situation you described and in a CRUD, how many times would you repeat the 'REPLACE' method in the query? And if you decide to change DBMS? Will leave your query stuck to Postgresql?
mount the query without the dots..
– Daniel Omine
On my system, I have a query screen where I prefer that the user does not need to type points... When he searches a CPF for example
– Emerson
Remove the dot when passing text from the screen to the query?
– Omni
I’m doing this query in a field in the event Textchanged. At the time he type, already go making the query
– Emerson
if this value is a user input, just remove the points before playing it in the query. You can do this in C# itself or SQL.. The fact that the data comes from a "Textchanged" event makes no difference..
– Daniel Omine