Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. LINQ
  4. I had an error of Email in line " dynamic email = new Email("ChngPasswordEmail");" which say's The type or Namespace name "Email" could not be found

I had an error of Email in line " dynamic email = new Email("ChngPasswordEmail");" which say's The type or Namespace name "Email" could not be found

Scheduled Pinned Locked Moved LINQ
asp-netdatabasebusinessarchitecturehelp
4 Posts 2 Posters 30 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13642228
    wrote on last edited by
    #1

    This is my code:

    public void ResetPassword(UserModel model, string Name)
    {

            using (var db = new sortit\_internEntities())
            {
                
                string emailAddress = (from info in db.users
                                       where info.name.Equals(model.Name)
                                       select info.email).Single();
    
                if (!string.IsNullOrEmpty(emailAddress))
                {
                    string confirmationToken =
                        WebSecurity.GeneratePasswordResetToken(model.Name);
                    dynamic email = new Email("ChngPasswordEmail");
                    email.To = emailAddress;
                    email.UserName = model.Name;
                    email.ConfirmationToken = confirmationToken;
                    email.Send();
                    
                }
               
                
            }
        }
    

    for resetting password for login and yes I am new to MVC, this code is in business layer of MVC for kind Information

    L 1 Reply Last reply
    0
    • U User 13642228

      This is my code:

      public void ResetPassword(UserModel model, string Name)
      {

              using (var db = new sortit\_internEntities())
              {
                  
                  string emailAddress = (from info in db.users
                                         where info.name.Equals(model.Name)
                                         select info.email).Single();
      
                  if (!string.IsNullOrEmpty(emailAddress))
                  {
                      string confirmationToken =
                          WebSecurity.GeneratePasswordResetToken(model.Name);
                      dynamic email = new Email("ChngPasswordEmail");
                      email.To = emailAddress;
                      email.UserName = model.Name;
                      email.ConfirmationToken = confirmationToken;
                      email.Send();
                      
                  }
                 
                  
              }
          }
      

      for resetting password for login and yes I am new to MVC, this code is in business layer of MVC for kind Information

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You already posted this in the C# forum. Please do not repost the same question in multiple places.

      U 1 Reply Last reply
      0
      • L Lost User

        You already posted this in the C# forum. Please do not repost the same question in multiple places.

        U Offline
        U Offline
        User 13642228
        wrote on last edited by
        #3

        Ya I know but firstly I thought this code will come in Linq and then I realize that this will come in C# that's why...

        L 1 Reply Last reply
        0
        • U User 13642228

          Ya I know but firstly I thought this code will come in Linq and then I realize that this will come in C# that's why...

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Considering your code does not contain any LINQ that is an interesting assumption.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups