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

  • Home
  • SEARCH
  • 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 5959081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:38:08+00:00 2026-05-22T18:38:08+00:00

I Loaded Data From Datatable to DatagridView which look like this: SerialNumber1 | Quantity

  • 0

I Loaded Data From Datatable to DatagridView which look like this:

SerialNumber1 | Quantity | Issued Quantity | Status  |
    00001     |     1    |                 |         |
    00002     |     2    |                 |         | 

I have this requirement which make me stuck .

I need to query The data data grid view records to verify if the loaded Serial Number is The Same as The Actual. (maybe by using linq – correct me if I’m incorrect)

Ex:

var dgviewData = from a in gdview1.AsEnumerable()
                 where a<string>("SerialNumber").tostring() == txtserial.text
                 select a;

if(a.Count() > 0 )
{
    // Update Status of SerialNumber 00001 to Ok 
}
else
{
   //Error Serial Not Exist on Gridview
}

If SerialNumbers on DGview is the same on the actual serial scanned , the status will be updated in runtime on datagridview row cell only.

Eg: DGview serial = 00001 —> actual unit scanned = 00001

SerialNumber1 | Quantity | Issued Quantity | Status  |
    00001     |     1    |        1        |   Ok    |
    00002     |     2    |                 |         |

Thanks in Regards….

  • 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-22T18:38:09+00:00Added an answer on May 22, 2026 at 6:38 pm

    Your LINQ query is a bit off, to get matching rows you should do:

    string scannedNumber = txtserial.text;
    var matchedRows = this.gdview1.Rows
        .Cast<DataGridViewRow>()
        .Where(r => scannedNumber.Equals(r.Cells[0].Value));
    

    Then to update “Issued Quantity” (cell at index = 2) simply do:

    foreach (var row in matchedRows)
    {
        row.Cells[2].Value = 1;
    }
    

    Unless you want to increment that number, then use Int32.Parse / .TryParse.

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

Sidebar

Related Questions

I'm using a DataGridView to load data from a DataTable. This DataGridView is located
I'm building a dynamic ExtJS form based on JSON data loaded from an ASP.NET
I have CSV data loaded into a multidimensional array. In this way each row
I loaded a custom DataTable into an UltraChart of type GanttChart . The data
I have a treeList, loaded with data from SQL DB. The logigs in sql
I want to display data loaded from a webservice but the webservice is taking
I have a Silverlight App which gets its data from a database. My Silverlight
I have a SL application that reads some data from the database, which I
Looks like simple,but doesn't work) When .jsf page is loaded ,values from DB is
I have used this code to load data from a plist. -(void)loadOrCreateData { NSLog(@Start

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.