# Import and Export

C1Scheduler control provides the functionality of importing and exporting different file formats. Learn more about importing and exporting in Scheduler for WinForms documentation.

## Content



You can add importing and exporting functionality to your scheduling application using the [Import](/componentone/docs/win/online-schedule/) and [Export](/componentone/docs/win/online-schedule/) methods. The **Import** method opens the **OpenFileDialog** dialog box, allowing you to import an XML or iCal file. The **Export** method opens the **SaveFileDialog** dialog box, allowing you to export an XML or iCal file. Additionally, you can manually select or enter \*.dat format to open or save files from OpenFileDialog or SaveFileDialog dialog boxes.


> type=note
> **Note**: In .NET 9, the binary format (.dat) is not supported, and therefore hidden by default in OpenFileDialog and SaveFileDialog. You can also use built-in importing and exporting features, see [Importing and Exporting Data](/componentone/docs/win/online-schedule/features/c1scheduleruntimecon/importingandexportin) for details.

In the following example, [C1Calendar](/componentone/docs/win/online-schedule/) and [C1Schedule](/componentone/docs/win/online-schedule/) controls are added to the form along with two buttons named **Import** and **Export**. When the application is run, you'll be able to import and export data into the C1Schedule control.

Complete the following steps to add importing and exporting functionality to a scheduling application:

1.  Create a new **.NET** application.
2.  From the toolbox, drag and drop the **C1Calendar**, **C1Scheduler**, and two **Buttons** onto the form.
3.  In the Properties window, set the **Name** and **Text** properties for buttons. In this example code, the **Name** property of first button is set to "buttonImport" and the **Text** property to "Import". Similarly, the **Name** property of second button is set to "buttonExport" and the **Text** property to "Export".
    
    The below image illustrates the sample layout of the form after placing all the controls:<br />
    
    ![](https://cdn.mescius.io/document-site-files/images/675b9aff-7616-4324-81ac-58e410fb9531/images/import-export-scheduler.png)
    
4.  Double-click the **Import** button. The Code Editor will open and the **buttonImport\_Click** event will be added. Add the below code to enable importing files:
    
    ```csharp
    private void buttonImport_Click(object sender, EventArgs e)
    {
        c1Schedule1.Import("Import a File");
    }
    ```
    
5.  Double-click the **Export** button. The Code Editor will open and the **buttonExport\_Click** event will be added. Add the below code to enable exporting files:
    
    ```csharp
    private void buttonExport_Click(object sender, EventArgs e)
    {
        c1Schedule1.Export("", "Export a File");
    }
    ```
    

### Run your application:

The **Import** and **Export** buttons will enable you to import and export appointments into your scheduling application. To Import and Export appointments from the application, perform the following tasks:

1.  Add a few appointments to the schedule.
2.  Click the **Export** button. The **Export a File** dialog box will open enabling you to export a XML or iCal file. For example, export the file as an XML file and name it "myFile.xml".
3.  Delete the appointments that you just added to the schedule.
4.  Click the **Import** button. The **Import a File** dialog box will open enabling you to import a XML or iCal file.
5.  Import the **myFile.xml** file you just saved and observe that the appointments you added are restored in the schedule.