C# Loops to compare many rows between 2 worksheets in C#?

  • Thread starter Thread starter sweetjones
  • Start date Start date
  • Tags Tags
    C++ Compare Loops
AI Thread Summary
A user is developing a C# tool to cross-reference part numbers from customer requests with lead times in a weekly report. They need advice on which control to use for varying numbers of part numbers and the appropriate loop for comparing two columns across different worksheets. The user finds working with Interop.Excel complicated and is seeking guidance to streamline their process. They express frustration over the complexity of their task, indicating a need for practical solutions. Input from the community is requested to overcome these challenges effectively.
sweetjones
Messages
44
Reaction score
0
Hello All,

I took it upon myself to create a tool for my job that xref 2 excel worksheets on 2 different workbooks. Customers send us parts and they're wanting the leadtimes for them. We have a weekly report that has all part numbers with their leadtimes. My goal is to create a GUI in C# that my team can copy & paste the customer's requested part numbers into a control, then click a button that generates a new excel file with those pasted parts in the 1st column. While simultaneously have the weekly report opened in the background. Compare each row of customer parts with the weekly report and if there's a match, provide it's respective leadtime number in column B. The only thing I have figured out so far is to open the workbooks and name the worksheet.(whoopty doo)

My issues so far:

1. What control to use in my windows form that can hold a varying number of part numbers? I know a rich textbox has limits. The number of parts a customer sends us vary. One could send in 50 part numbers, and someone else could send 2000 parts.

2. What type of loop should be used to compare 2 columns on 2 different worksheets, and provide their respective row of info?


In theory this seemed pretty straight forward and not that difficult, but it seems like working with Interop.Excel gets pretty messy. Looks like I've dug myself a deep hole. I would really appreciate any input that you may have.

Thanks in advance!
 
Technology news on Phys.org
Hi

my question is if there are any other free flex-paced similar online courses to Freecodecamp that give out a certification at the end of the course. I've been using FreeCodeCamp (www.freecodecamp.com) for a few weeks now. I love it. My question is if there are any other similar online free flex-paced computer programming classes that give out a certification at the end of the course. Thank you.
 
I have a large C program running under Qnx7. It does a lot of stuff: TCP, terminal and file IO, Qnx messaging, etc., but none of which is relevant to my question.

Been chasing down a bug in the C library read() function which intermittently returns bad data with no error indication (a 2nd read from the same file offset usually returns the correct data). To try to track it down I trap and pass all calls to the C lib read() through my own identically prototyped read_wedge() function, which fills the passed buffer with repeated calls to read() of some maximum number of bytes. If this max value is 16 or less, the program runs fine for days. At 32 if failed after 20 hours of pounding. At 256 it fails in relatively short order. The larger this number, the more likely read() is to fail it seems. I've learned over the years that blaming the OS is not conducive to finding bugs. But, and this is my question, this has to be the OS, right? (I'm thinking either interrupts or caching.)
 
Hi at all!

I need to insert a matrix in another bigger one using Boost library. An example:
I have a matrix A (3x3) and i want to insert it into an identity matrix B (4x4) in this way

matrix_block.jpg


This is my code:
C++:
boost::numeric::ublas::matrix<double> A(3,3);
boost::numeric::ublas::identity_matrix<double> B(4,4);

for (unsigned int i = 1; i < B.size1(); ++i)
{
    for (unsigned int j = 1; j < B.size2(); ++j)
    {
        B(i, j) = A(i - 1, j - 1);
    }
}

Is there a better way to do this using Boost library?

Thanks!
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top