Click here to Skip to main content
15,884,298 members
Articles / Programming Languages / C#

Databind a GridView and export to Excel or text file

Rate me:
Please Sign up or sign in to vote.
4.75/5 (4 votes)
14 Aug 2012CPOL 36.2K   1.5K   6  
Binding a database table to a GridView and exporting the GridView data to an Excel text file. An Excel file is used to store information.
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Export_Demo.Properties" GeneratedClassName="Settings">
  <Profiles />
  <Settings>
    <Setting Name="Export_DBConnectionString" Type="(Connection string)" Scope="Application">
      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;ConnectionString&gt;Data Source=.;Initial Catalog=Export_DB;Integrated Security=True&lt;/ConnectionString&gt;
  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;
&lt;/SerializableConnectionString&gt;</DesignTimeValue>
      <Value Profile="(Default)">Data Source=.;Initial Catalog=Export_DB;Integrated Security=True</Value>
    </Setting>
  </Settings>
</SettingsFile>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions