Skip to main content

Posts

Showing posts from November, 2008

How to Read & Write Data in Excel Files with C#.NET 2005

Have you ever tried to read and write data in any Excel file with C#.NET 2005 or higher. The following code shows how to read and write with an Excel file having the following structure: Structure of Excel File SrNo Ename Salary 1. For Reading the Data from Excel File.(Format .xls/.xlss) //Code for reading the contents of Excel file and display the same on datagridview private void button1_Click( object sender, EventArgs e) { //FOR READING THE EXCEL FILE OleDbConnection vConn = new OleDbConnection ( "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\rohit.xls;Extended Properties=Excel 12.0" ); //Reading the Content from a sheet named Employees String strSQL = "SELECT * FROM [Employees$]" ; OleDbCommand cmd = new OleDbCommand (strSQL, vConn); DataSet ds = new DataSet (); OleDbDataAdapter da = new OleDbDataAdapter (cmd); da.Fill(ds, "emp" ); //Displaying the data read fro

Microsoft Demos pre-beta built Windows 7 UI

Microsoft has publically shown off the Windows 7, the new successor to the Windows Vista. The pre-beta build looks quite solid & responsive. It was shown at PDC 2008 in Los Angeles. Initial reviews about the new Windows 7 Ui are very encouraging. Few featuers that are new in the Windows 7 are: 1. New and improved taskbar 2. Jump List 3. Device Centre Stage 4. Libraries Storage etc. Snapshot of the new Task bar in Windows 7