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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:14:44+00:00 2026-05-28T01:14:44+00:00

I have a datagridview with a checkbox column at the beginning, what i want

  • 0

I have a datagridview with a checkbox column at the beginning, what i want to happen is that when I press the Ok button it will update the Requested row in my EquipmentDetail table with the corresponding checked chekcboxes.

The problem is that when I check even only one checkbox … All of the rows are updated into true even if its not checked in the datagridview …

 For Each row As DataGridViewRow In DataGridView1.Rows
        req = row.Cells(Column1.Name).Value
        If row.Cells("Column1").Value = True Then
            Dim sql2 As String = "UPDATE EquipmentDetail SET Requested = '" & req & "'"
            cmd2.Connection = connection
            cmd2.CommandText = sql2
            cmd2.ExecuteNonQuery()
        End If
    Next
    connection.Close()
End Sub

help me please … thanks …

  • 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-05-28T01:14:45+00:00Added an answer on May 28, 2026 at 1:14 am

    In your update statement you are updating all records in the EquipmentDetail table, you should have a “WHERE” clause in the UPDATE statement.

    Dim sql2 As String = “UPDATE EquipmentDetail SET Requested = ‘” & req & “‘” & “WHERE ID=” & ID(the id of the Row in the EquipmentDetail table)

    Hope this helps!

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

Sidebar

Related Questions

I have datagridview with checkbox column, but I want, that some of the columns
I have a datagridview that I've added a checkbox column to. When I preview
I have a DataGridView that I want to query using Linq (C# WinForm). I
hi i have a datagridview whose first column (index = 0) is a checkbox
Ok, the first column in my datagridview is a checkbox. I have 'multiselect' set
I have a DataGridView with a single column that currently displays a short list
My datagridview has a checkbox column that is only valid for some records in
I have datagridview with checkbox column, and the checkbox within the column can be
I have a dataGridView that has a column with checkboxes. Whenever the user clicks
I have a DataGridView that's populated and bound dynamically. One column is a CheckBoxColumn.

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.