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 8102653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:17:53+00:00 2026-06-05T23:17:53+00:00

I am building a program that will update an early voted column in my

  • 0

I am building a program that will update an early voted column in my data base with a 1 if the voter early voted. I need a way that users can upload a CSV’s and match the id column of that CSV to the id of the voter in my database, and then update his early voted status. Since the CSV’s will be coming from users I will not know the amount of columns in the CSV’s, some may have 2 columns some may have 10, but all will have an id column that will match the id of a voter in my database. I have the code that uploads the CSV and insert it into the datatable, but I need help with the logic for the insert into the database. I was thinking something like this, but don’t know the correct way to handle it.

 UPDATE personal SET earlyVoted = 1 where personal.id = datatable.id 

This is the code I have for the datatable

string target = Server.MapPath("~/Upload");
    if (FileUpload1.HasFile)
    {
        FileUpload1.SaveAs(System.IO.Path.Combine(target, FileUpload1.FileName));
        string connString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=Text;", System.IO.Path.GetDirectoryName(target + "\\" + FileUpload1.FileName));
        string cmdString = string.Format("SELECT * FROM {0}", System.IO.Path.GetFileName(target + "\\" + FileUpload1.FileName));
        OleDbDataAdapter dataAdapter = new OleDbDataAdapter(cmdString, connString);
        DataSet dataSet = new DataSet();
        dataAdapter.Fill(dataSet);
        GridView1.DataSource = dataSet.Tables[0];
        GridView1.DataBind();
    }       

Thanks in advance

  • 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-05T23:17:56+00:00Added an answer on June 5, 2026 at 11:17 pm
    UPDATE (SELECT personal.earlyvoted 
              FROM personal
                 , datatable 
             WHERE personal.id = datatable.id) 
       SET earlyvoted = 1; 
    

    You’ll need primary key on id in each table.

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

Sidebar

Related Questions

I'm building a program that performs some users tests and needs to record data
I'm building a graphical program that will need to show files on both the
I'm building a Java program that will automatically run a hundred or so tests.
I'm building a client and a server program that exchanges data over TCP and
I need to write an accounting routine for a program I am building that
I'm building a program that does network acceleration, and I need to know how
I'm building a JFrame that will eventually display the output of a program that
I am building a C# program for a company that eventually will store information
I'm trying to teaching myself how to program by building programs/scrips that will be
I am building a program that takes an input file in this format: title

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.