Click here to Skip to main content
15,902,114 members

Comments by Member 12962919 (Top 12 by date)

Member 12962919 10-Sep-18 0:49am View    
Can you tell where to add Tonumber. before sum or after sum. Because when add it after sum its gives error to many argument.
Member 12962919 2-Nov-17 0:52am View    
The query problem is solved but it add some additional columns in table like Table_catalog,table_schema,table type
Member 12962919 1-Nov-17 9:37am View    
I used this but this gives me error in query
here is code

OleDbConnection connection = null;

try
{
string excelConnectionString = string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties='Excel 8.0;HDR=Yes'", path);
connection = new OleDbConnection();
connection.ConnectionString = excelConnectionString;
connection.Open();
DataTable table = new DataTable("Customers");
table = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
String[] excelSheets = new String[table.Rows.Count];
int i = 0;

// Add the sheet name to the string array.
foreach (DataRow row in table.Rows)
{
excelSheets[i] = row["TABLE_NAME"].ToString();
i++;
}
string Sheet = excelSheets[1];

string query = "select * from" + Sheet;
OleDbCommand command = new OleDbCommand(query, connection);

DbDataReader dr = command.ExecuteReader();

table.Load(dr);
Member 12962919 27-Oct-17 6:31am View    
thanks problem solved
Member 12962919 6-Oct-17 2:49am View    
but if i used ClosedXML then it should be necessary that excel is installed on client system like interop.