Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how read excel data in c#

string con =
  @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:	emp	est.xls;" + 
  @"Extended Properties='Excel 8.0;HDR=Yes;'";    
using(OleDbConnection connection = new OleDbConnection(con))
{
    connection.Open();
    OleDbCommand command = new OleDbCommand("select * from [Sheet1$]", connection); 
    using(OleDbDataReader dr = command.ExecuteReader())
    {
         while(dr.Read())
         {
             var row1Col0 = dr[0];
             Console.WriteLine(row1Col0);
         }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# split string by index 
Csharp :: c# form set auto scale 
Csharp :: how to trim path in C# 
Csharp :: c# string right extension 
Csharp :: c# draw rectangle on screen 
Csharp :: get int value from enum c# 
Csharp :: c# best way to loop and remove 
Csharp :: c# remove substring 
Csharp :: unity input system 
Csharp :: ihttpactionresult to object c# 
Csharp :: Oculus Unity button press 
Csharp :: XMLWriter write xml C# 
Csharp :: c# datetime remove days 
Csharp :: convert c# string to int 
Csharp :: List C# add from List 
Csharp :: how to fix on GetMouseButtonDown activating UI unity 
Csharp :: finding keys in the registry 
Csharp :: how to change all values in dictionary c# 
Csharp :: mvc c# return renderPartial 
Csharp :: c# only letters 
Csharp :: Get Mac address of Device in Xamarin 
Csharp :: private Vector3 direction; 
Csharp :: asp.net get most recent file in directory 
Csharp :: upload a file selenium c# 
Csharp :: c# json 
Csharp :: link form to a button in dashbord visual c# 
Csharp :: spiral matrix 
Csharp :: set request size c# 
Csharp :: how to call an If statement only once in C# 
Csharp :: c# trimend substring 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =