Click here to Skip to main content
16,022,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
How do I can set special row of column of Excell to textbox windows form
I have a table in Excel I want column A in Excel be reference other column I want take a data
when I chose the specific name in textBox1 like "Milk" I want search in Excel file then find the "Milk" in column A in Excel finally fill the other textbox in windows Form automatically.

Thank you

Ali


What I have tried:

I wrote codes but it not good if anyone can help me take me a big favor
Posted
Updated 11-Jun-24 21:07pm
v2

Microsoft provide a nice interface specifically for such an issue: Microsoft.Office.Interop.Excel Namespace | Microsoft Learn[^].
 
Share this answer
 
Comments
Member 16284027 12-Jun-24 4:48am    
Hi Richard MacCutchan
Thank you for your suggestion I will see it as soon then
That's going to depends on how you access the Excel data - the most obvious way is to open the file using OleDB, and use an SQL SELECT operation similar to this:
SQL
SELECT ColumnB FROM MySheet WHERE ColumnA='Milk'
But you are going to have to be a lot more precise in describing your circumstances and what you have tried so far to get a specific solution.
 
Share this answer
 
Comments
Member 16284027 12-Jun-24 4:46am    
Hi OrginalGriff
Thank you for your answer
at the first I need to say My English is not good if I have wrong to write my sentences please accept my apologize
I am trying to write a simple code
I think after that when I write code here you can help me
OriginalGriff 12-Jun-24 5:06am    
Yes, but you have to remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900