Tag-Archive for ◊ integration ◊

Read excel file without worksheet name
Thursday, August 20th, 2009 | Author: admin

A few times we need to load data from Excel file but we don’t know the name of the worksheet.
There are many ways to do, but i like this one because don’t need to instantiating an Excel object.

C# code:

String conString = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=c:\temp\ExcelFile.xls;Extended Properties=Excel 8.0;";

OleDbConnection yourConnection = new OleDbConnection(conString);

try

{

yourConnection.Open();

DataTable sheetTable = yourConnection.GetSchema("Tables"); //get all tables

DataRow rowSheetName = sheetTable.Rows[0];

String sheetName = rowSheetName[2].ToString();

yourConnection.Close();

}

catch (Exception ex)

{

}
Enjoy :)

In VSS 2005 when you now choose to add files,
you can only add single files and don´t appear an option to folders or recursive.
But with this Tip it’s possible :)


When you hold shift and then click the button on the toolbar for adding files,
you will get the ‘old’ dialog(previous version), and so be able to check in complete directory structures and files into Visual SourceSafe 2005 but if you want to add all sctruct click in Recursive checkbox