Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7834087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:03:26+00:00 2026-06-02T13:03:26+00:00

I am storing an applicants text box data in a session class. I am

  • 0

I am storing an applicants text box data in a session class. I am calling the session class and storing it in an object.

How can i loop through the items, and add them to a database?

Can i loop through and concatenate into a string? I am using a data access layer and an oracle database.

Here is the string for the insert in the DAL. I dont have the function complete since i dont know what to pass in at this point. But, i do have a runquery function that works that i pass the string sql into.

public void AddJobApplication()
{
string sql = "insert into JOBQUESTIONS (JOBAPPLICATIONID, QUESTIONTEXT, TYPEID, HASCORRECTANSWER, CORRECTANSWER, ISREQUIRED) VALUES (" + JobID + ", \'" + QuestionText + "\', " + TypeID + ", " + HasCorrectAnswer + ", \'" + CorrectAnswer + "\', " + IsRequired + ")";
 RunQuery(sql);

}

Here is my session class

public class JobApplicantSession
{

    public JobApplication ApplicationSession
    {

      get {if (HttpContext.Current.Session["Application"] != null)
               return (JobApplication)HttpContext.Current.Session["Application"];
           return null; }

      set{ HttpContext.Current.Session["Application"] = value; }
    }


}

Then, i can retrieve that session and store it in an object

JobApplicantSession _sessions = new JobApplicantSession();
JobApplication _application;
_application = new JobApplication(jobID);
_sessions.ApplicationSession = _application;   //_application holds all my saved textbox texts

JobApplication application;

var jas = new JobApplicantSession();
application = jas.ApplicationSession;   //holds all my session text

I want to insert multiple records in table JOBQUESTIONS and i have all these records in the application variable

Thank you!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T13:03:27+00:00Added an answer on June 2, 2026 at 1:03 pm

    Couple of things:
    First its seems that JobApplication is an object which is holding data for a particular job application. You can’t do iteration on that. You probably need a list of JobApplication and your object application should be something similar to
    List<JobApplication> applications = new List<JobApplication>();
    You can only iterate using foreach through an object if it has Ienumerable interface implemented. (Generally speaking an Array of objects or List of Objects)

    For inserting data in database, once you were able to iterate and construct a query, I would recommend building a single insert statement with multiple values. Then call it once to insert data in database. Please do take care of SQL Injection. Also if you think that using multiple insert statements suits your need then use a transaction

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For storing data offline WebApp can use: session storage, advanced version of cookies key/value
Is storing a list of 1000 instance of my custom class to the session
I am storing multiple items into one session variable: which is 4 different words.
Im storing columns in database with users able to add and remove columns, with
My application is storing location data from GPS inputs. When importing a GPX file,
Storing the session id on the client computer is no problem and is very
Storing the entire session in a cookie has been standard in Rails for the
Storing data permanently in an iPhone is usually done using Core Data or sqlite3.
When storing latitude or longitude data in an ANSI SQL compliant database, what datatype
I have a simple class called Applicant. I'm trying to add a template controller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.