Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exporting to Excel format
Message
De
24/04/2006 13:27:06
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Divers
Thread ID:
01115863
Message ID:
01116081
Vues:
23
>>>>Check KB306022 (and 306023 for C# version). You can transfer the data with or without excel installed. There is not something that exactly matches VFP's copy to ... xl5 but transferring with ADO.Net with an existing template file it's easy (that is you have a precreated and saved xls file with the layout of your table headers + row under it is defined with a name - you connect to this xls using Jet.Oledb driver).
>>>
>>>I have various export to do and they have data from various tables and fields. So, I guess this will not work.
>>
>>Michel,
>>It'd. You can simply save it as an HTML (and excel2002 and up can also read a simple XML natively).
>>Cetin
>
>
>Ok, why not use the data handeling of .NET to do it for you?
>
>1) rights to a folder to write details to.
>2) rights t send that file out to browser.
>
>// Establish a connection to the data source.
>System.Data.OleDb.OleDbConnection objConn = new System.Data.OleDb.OleDbConnection(
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + m_strSampleFolder +
> "Book7.xls;Extended Properties=Excel 8.0;");
>objConn.Open();
>
>// Add two records to the table named 'MyTable'.
>System.Data.OleDb.OleDbCommand objCmd = new System.Data.OleDb.OleDbCommand();
>objCmd.Connection = objConn;
>objCmd.CommandText = "Insert into MyTable (FirstName, LastName)" +
> " values ('Bill', 'Brown')";
>objCmd.ExecuteNonQuery();
>objCmd.CommandText = "Insert into MyTable (FirstName, LastName)" +
> " values ('Joe', 'Thomas')";
>objCmd.ExecuteNonQuery();
>
>// Close the connection.
>objConn.Close();
>
>I was always thinking of AVOIDING office automation on the server. So this could do it for you in a more data direct manner.
>
>__Stephen

Stephen,
Sorry couldn't understand what you mean. This code is already from the KB I suggested I think and couldn't see the difference.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform