Skip to main content

Popular posts from this blog

crystal reports using stored procedures in asp.net

  crystal reports using stored procedures in asp.net   ReportDocument document = new ReportDocument ();         document.Load( this .Page.Server.MapPath( "~/CRY/crTest.rpt" ));         string str = ConfigurationManager .AppSettings[ "ConnectionString" ];         string server = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));         str = str.Substring(str.IndexOf( ";" ) + 1);         string database = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));         str = str.Substring(str.IndexOf( ";" ) + 1);         string user = str.Substring(str.IndexOf( "=" ) + 1, str.IndexOf( ";" ) - (str.IndexOf( "=" ) + 1));        ...

CRUD in EF

 public int Create(Users entity)         {             using (var context = new K305DataEntities())             {                 var newEntity = Mapper.Map<User>(entity);                             context.Users.Add(newEntity);                 context.SaveChanges();                 return newEntity.Id;             }         }         public int Update(Users entity)         {             using (var context = new K305DataEntities())             {                 var dbEntity = context.Users.FirstOrDefault(d...