public stud SearchStud(int sid) { try { stud s = dc.studs.Single(s1 => s1.rno == sid); return(s); } catch (Exception e) { return(null); } }
public string InsertStud(stud ss) { try { dc.studs.InsertOnSubmit(ss); dc.SubmitChanges(); return("Inserted"); } catch (Exception e) { return(e.Message); } }
public string DeleteStud(int sid) { try { stud s = dc.studs.Single(s1 => s1.rno == sid); dc.studs.DeleteOnSubmit(s); dc.SubmitChanges(); return("Deleted"); } catch (Exception e) { return(e.Message); } }
public string UpdateStud(stud ss) { try { stud s = dc.studs.Single(s1 => s1.rno == ss.rno); s.rno = ss.rno; s.sname = ss.sname; s.course = ss.course; dc.SubmitChanges(); return("Updated"); } catch (Exception e) { return(e.Message); } }
partial void Deletestud(stud instance);
partial void Updatestud(stud instance);
partial void Insertstud(stud instance);