public static int AdmNoExists2(int admno) { DbAccess db = new DbAccess(); object c = db.ExecuteScalar("Select Count(*) from Student where AdmNo = '" + admno + "'"); return (Convert.ToInt32(c)); }
public static bool AdmNoExists(int admno)//To check that admission number already exists or not { DbAccess db = new DbAccess(); object c = db.ExecuteScalar("Select Count(*) from Student where AdmNo = '" + admno+ "'"); if (Convert.ToInt32(c) == 0) return false; else return true; }