Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

how to check boolean returned value in a condition in asp.net

$
0
0

I am getting a value rollNo from testA table and then I am checking the value in query that if the value matches to any row of my another table called testB. I am adding my query bellow

publicboolDoesRollNoExists(int rollNo){string sql =@"SELECT COUNT(*) AS Rowcount FROM testB WHERE ROLLNO = @rollNo;";QueryParamList paramList =newQueryParamList();
        paramList.Add(newQueryParamObj(){ParamName="ROLLNO ",ParamValue= rollNo,DBType=DbType.Int32});string errorStr =String.Empty;DataTable dt =LoadDataTable(sql, paramList,"testB ",ref errorStr);returnInt32.Parse(dt.Rows[0]["Rowcount"].ToString())>0?true:false;}

Now my question is how can i check this into condition.

I am adding another source of code with the condition.

if(((DataRowView)e.Item.DataItem).Row["IsActiveStatus"].ToString()=="False"){boolDoesRollNodExists=ApplicantManager.DoesRollNodExists(rollNo);if( what condition i should put here){
                    item.CssClass="Green"+" rgRow";}else{
                    item.CssClass="Red"+" rgRow";}}

</div> </div>


Viewing all articles
Browse latest Browse all 1698

Trending Articles