London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

How to retrieve specific form submission data??

Vote:
 

Hi Guys,

    I created Registration and contactus form,both forms data saved in tblBigTable.Now i want to retrieve only registration form data,but my logic will retriev all the forms  data,here is the code.

   

public class LoadformdataController : PageController
{
 List submittedData;
 private Injected _formRepository;
 DataTable dt = new DataTable();
 public ActionResult Index(Loadformdata currentPage)
 {
   DataTable dt = new DataTable();
   dt.Columns.Add("Name", typeof(string));
   dt.Columns.Add("Number", typeof(string));
   dt.Columns.Add("Mail", typeof(string));
   dt.Columns.Add("Gender", typeof(string));
   FormDataRepository _formDataRepository = new FormDataRepository();
   var formsInfo = _formRepository.Service.GetFormsInfo(null);
foreach (var info in formsInfo)
{
  submittedData = _formDataRepository.GetSubmissionData(
  new FormIdentity(info.FormGuid,currentPage.Language.Name),
  DateTime.Now.AddDays(-100),
  DateTime.Now).ToList();

  List li = new List();
 }
  return View(currentPage);
 }
}

The above code retriev all forms data,Can anyone help me out of this.

Thanks,

Kartheek

#187588
Jan 29, 2018 10:07
Vote:
 

If you ONLY want to have 1 form data, you need filter formInfo. Example:

formsInfo = formsInfo.Where(f =>f.Name.Equals("ContactUs"))

Then call  _formDataRepository.GetSubmissionData to get its data.

#187593
Jan 29, 2018 11:03
Vote:
 

Thank You,Dac Thach Nguyen

#187622
Jan 30, 2018 6:50
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.