-1
I need help for comparison in "if" c# of a datatable database return.
Below the code snippet:
public class ArcerarDto
{
public DataTable SelectArcerarContract()
{
ArcerarDal arcerarObj = new ArcerarDal();
DataTable arcerarDt = arcerarObj.SelectArcerar();
if (arcerarDt.Rows[0][2].ToString() = 'N') ///// erro aqui
{
//logFile "ERRO", "Contrato do xxx está Inativo."
//aborta processamento
}
And what is the doubt?
– Jéf Bueno
Well I don’t know yet if it’s the best way to compare plus an equal sign is assignment and two equals sign together is comparison, so your code might just be typo.
– novic
thank you Virgilio!
– Thathi
Can’t even compare string to char do...
== "N"
– vik
Thank you so much for your help! It worked
– Thathi