Checking The null condition
-
How i check if a cloumn value is null when already a search condition is avilable.I want to put a cloumn value from the database.Getting the value on a serch condition,also if the returned value is null thn an error occurs in sql.I want to chk if the value is null or not ,if the value is not null return the value..How the query is wriiten for that. sqlstatement = "SELECT UnitId FROM user_UnitRoles WHERE UserId='"+UserId+"' "; object s=dbtObj.GetColumnValue(sqlstatement, "UnitId"); return s.GetType().ToString(); I attach the query with this mail .Plz tell what changes i want to do
-
How i check if a cloumn value is null when already a search condition is avilable.I want to put a cloumn value from the database.Getting the value on a serch condition,also if the returned value is null thn an error occurs in sql.I want to chk if the value is null or not ,if the value is not null return the value..How the query is wriiten for that. sqlstatement = "SELECT UnitId FROM user_UnitRoles WHERE UserId='"+UserId+"' "; object s=dbtObj.GetColumnValue(sqlstatement, "UnitId"); return s.GetType().ToString(); I attach the query with this mail .Plz tell what changes i want to do
I am not sure what you asking but i feel you should try to compare returned value to System.DBNull in .NET CLR.
P.S.
-
I am not sure what you asking but i feel you should try to compare returned value to System.DBNull in .NET CLR.
P.S.