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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:57:15+00:00 2026-06-09T11:57:15+00:00

How can i select multiple rows from database when multiple checkbox have been checked.

  • 0

How can i select multiple rows from database when multiple checkbox
have been checked. here’s the code.if you look at the line where i used query string
there is double Request that i don’t know what else i have to insert.

@{
    var db = Database.Open("Checkbox");
    var sql = "SELECT * FROM Brands";
    var select = db.Query(sql);
    dynamic execute = "";
    List<String> selected = new List<string>();
    int count = 0;
    List<dynamic> exec = new List<dynamic>();


    if(IsPost){
        if(Request["List"] == null){
            Response.Redirect("~/Checkbox");
        }
        selected = Request["List"].Split(',').ToList();

        count = Request["List"].Count();

        var sqls = "SELECT * FROM Brands WHERE Name = @0 OR Name = @1";
        exec = db.Query(sqls, Request["List"], Request["List"]);



}

<!DOCTYPE html>
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  <title>Checkbox Multiple</title> 
</head>
<body>
    @foreach(var values in exec){
        <span>@values.BrandID</span>
    }

    <form method="post" action="">
    @foreach(var item in select){
    <label>@item.Name</label>     
    <input type="checkbox" multiple="multiple" name="List" value="@item.Name"><br>
    }
    <input type="submit" value="Send">    
        </form>
</body>


</html>
  • 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-09T11:57:16+00:00Added an answer on June 9, 2026 at 11:57 am

    You can try using in query and construct a comma separated string and pop it in the query.

    string inClause = "1, 2, 3";
    
    var sqls = "SELECT * FROM Brands WHERE Name in (" + inClause +")";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following select list from which the user can select multiple values.
Currently we have dueling select lists where you can select multiple employees from Available
I am trying to select multiple rows from the database and then separate the
As we can select multiple rows into single variable declared as some_table.rowtype in SQL.
I want to make a view where I can select multiple items from listview
I'm trying to pull multiple rows from different tables in a database. If I
I want to select all rows from my database where the id is equal
I have a problem reading out multiple rows that get returned from an SQLite
I am using multiple choice ListView items. The user can select multiple items. So
In certain text editors, like E, I can select multiple locations and, as I

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.