You must Sign In to post a response.
  • Category: ASP.Net MVC

    How to call a storedprocedure in mvc using entity framework and triggermail to "velidiraviram@gmail

    hi all
    i have written code to cal a storedprocedure in mvc using entity framework and to triggermail to me so where i am wrong helpme

    in my common files poaperakaleter.cs
    public void MailSchedule()
    {
    log4net.ILog logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
    logger.Info("Begin of job - MailSchedule");
    eProEntities db = new eProEntities();
    try
    {
    ObjectParameter result = new ObjectParameter("outflag", typeof(Int32));
    var outputSP = db.process_porespone();
    outputSP = db.process_porespone();
    foreach (var email in outputSP)
    {
    EMailHelper.SendMail(email);
    }
    }
    catch (Exception ex)
    {
    logger.Error("Error in job - MailSchedule", ex);
    }
    db.Dispose();
    logger.Info("End of job - MailSchedule");
    }


    in global.aspx in application start

    JobManager.AddJob(new Common.eBPJobScheduler().MailSchedule, s => s.ToRunEvery(1).Days().At(06,30));
  • #768778
    Hai VELIDIRAVIRAM,
    You have not mentioned that where you are getting the issue? Is there any error message which is getting whne you use this code?
    Please write in details so that we can provide the correct solution.
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com


Sign In to post your comments