473,320 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C# Autocomplete textbox using excel as a database?

So I am creating a windows form application that has a autocomplete text box. I want the text box to pull data from an excel spreadsheet. How would I go about doing this? I noticed that you cannot transfer the items from a multideminsional into the text box, however, that is the only way I know how to pull the data from excel. Any suggestions?
Feb 19 '19 #1
2 12865
Luuk
1,047 Expert 1GB
Show your example code, and if you can transfer items from a 'multideminisional' (probably you mean multidimensional) , you should already have enough knowledge.
Because 1 row, of 1 columns, is also multidimensional.
Even 1 cell is multidimensional, it has a width, and a height.
Apr 22 '19 #2
Cezar
3 2Bits
To read data from Excel worksheet, you'll need to use an Excel library, such as Free Spire.XLS for .NET.

The following code example shows you how to export data from excel to datatable using it. Then you could traverse the items in the datatable and insert them into your textbox.
Expand|Select|Wrap|Line Numbers
  1. //Create a new workbook
  2. Workbook workbook = new Workbook();       
  3. //Load excel file
  4. workbook.LoadFromFile(@”‪C:\Users\Administrator\Desktop\Data.xlsx”);          
  5. //Get first worksheet
  6. Worksheet sheet = workbook.Worksheets[0];
  7. //Export to datatable
  8. DataTable dataTable = sheet.ExportDataTable();
  9.  
Jan 12 '22 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Juan Sanchez | last post by:
Hi there, I have a VB.NET application using EXCEL it run fine in some computers but now in a specific one I receive the error QueryInterface for interface Excel._Application failed....
9
by: Lukman | last post by:
Hi, Do you know how to display ASP.NET result (database result from ADO.NET) using Excel in IE ? Thanks,
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
5
by: Mike in Santa Rosa | last post by:
I'm trying to get a simple c# app built that can launch/manipulate an excel workbook, sheet. I've chased down several examples and can't any of them to work. So I must be doing somethnig obviouslt...
8
by: nil | last post by:
Hello all, It's urgent... i want to add autocomplete textbox facility in my application like google. as you type it suggests option to the user..i want the same kind of facility...i know i...
3
by: chirag1989 | last post by:
how can i add data to database using excel through asp actual i wanted to use datagrid but as its not supported by asp so i want to try dat by excel can any one just provide me a short code...
1
by: jagwinderwalia | last post by:
Hi all i have build a autocomplete textbox control that works on keyup event in javascript. everytime a keyup is called , a request is send back to server and the suggestion are displayed in div...
2
by: Riak | last post by:
Hellow Helpers: I am doing data entry job manually and data is huge. Now I was told to write/get some sort of program/script which can do this job quickly, otherwise I will loose job. I am good...
7
by: Sirajuddin | last post by:
Hi, With great hope im writing this email. I wish and hope someone can help me. Im trying to get code for Autocomplete Textbox. I mean im looking for textbox which will autocomplete textbox...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.