Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2005, 12:49 AM
Authorized User
 
Join Date: May 2005
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to delete data from MS Excel Workbook database

Hi Friends,

How are you all? Hope you are doing well. Right now I am doing a project in ASP.NET with C#.
I have successfully inserted, selected data from ASP.NET to Microsoft Excel Workbook database.
But how to delete data from Microsoft Excel Workbook database in ASP.NET.

The insert code of “MS Excel Workbook” database in ASP.NET is given below.

SqlDataReader aReader ;
            aReader = objCmd.ExecuteReader();

            //---------------EXCEL CONNECTION -----------------------

            String source;
            OleDbConnection con;
            OleDbCommand cmd;
            source = "Provider=Microsoft.Jet.OLEDB.4.0;" +
                "Data Source=" + @"C:\swa.xls;" +
                "Extended Properties=Excel 8.0;";


            con = new OleDbConnection (source);
            con.Open();

            //Add two records to the table named 'MyTable'.

            cmd = new OleDbCommand(source,con);
            while(aReader.Read())
            {
                string cmdText="";
                cmdText = "Insert into [Sheet1$] "+
                "([Nam ID], [Nom ID])values(" +

    "'"+ aReader["Nam ID"].ToString()+"',"+
    "'"+ aReader["Nom ID"].ToString() +"')";

                cmd.CommandText = cmdText;
                text1.Text = cmdText;
                cmd.ExecuteNonQuery();

Hope you all understand the problem.

Thanks,

Regards,

Swadhin.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write data on ms excel azharrahi ASP.NET 1.x and 2.0 Application Design 0 January 11th, 2008 08:35 AM
How can we import the data from Ms Excel balesh ASP.NET 1.0 and 1.1 Professional 1 June 8th, 2006 02:15 PM
Import Excel data into a workbook Derek_05 Excel VBA 5 May 31st, 2006 02:02 PM
Getting data from MS Excel to ASP. rupen Classic ASP Basics 4 August 12th, 2005 04:01 PM
Exporting data from MS Excel sheet to Ms Access ajindal General .NET 1 January 17th, 2005 03:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.