nancybryant

Figuring out the technique to create connection string to excel sheet with C#?

Discussion created by nancybryant on Jun 12, 2017

Public static string fileName = string.Format("{0}\\Book502", Directory.GetCurrentDirectory()); 

String connection = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source={0};Mode=ReadWrite;Extended Properties='Excel 12.0 Xml;HDR=YES'", fileName);

There are two sheets in the file book 502. There is a purpose for having two sheets. From sheet 1, the data is viewed from it. Apart from just reading the data, in this sheet inserting and updating is also done to keep the data up to date. There are following columns in sheet 1:
User name char (255)
ID integer
Country char (255)

On the other hand, sheet 2 have following columns:
Member name char(255)
ID integer

To make it more specific, both sheets mainly involve text except where numbers are used in ID columns. The sheet will be shared with 3 users for edit and viewing data. The total size of the sheet is going to be around 5000 rows.

I would like experts especially those from the best software development company in UAE to help me figure out the correct format to create connection string to excel sheet.

Outcomes