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);
     }
 }
Exemple #5
0
 partial void Deletestud(stud instance);
Exemple #6
0
 partial void Updatestud(stud instance);
Exemple #7
0
 partial void Insertstud(stud instance);