--- title: "How to: Retrieve Data in a Particular Data Format" ms.date: "03/30/2017" ms.custom: devdivchpfy22 description: Learn how to retrieve Data in a particular Data Format. dev_langs: - "csharp" - "vb" helpviewer_keywords: - "drag-and-drop [WPF], retrieving data" - "DataFormats class [WPF], retrieving data" - "DataObject class [WPF], retrieving data" ms.assetid: a625acf3-1144-44cd-add7-456aefc3859f --- # How to: Retrieve Data in a Particular Data Format The following examples show how to retrieve data from a data object in a specified format. ## Use the GetDataPresent(String) overload to retrieve the data ### Description The following example code uses the overload to first check if a specified data format is available (natively or by auto-convert); if the specified format is available, the example retrieves the data by using the method. ### Code [!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_getspecificdataformat)] [!code-vb[DragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_getspecificdataformat)] ## Use the GetDataPresent(String, Boolean) overload to retrieve the data ### Description The following example code uses the overload to first check if a specified data format is available natively (auto-convertible data formats are filtered); if the specified format is available, the example retrieves the data by using the method. ### Code [!code-csharp[DragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat_Native](~/samples/snippets/csharp/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/CSharp/Window1.xaml.cs#_dragdrop_getspecificdataformat_native)] [!code-vb[DragDrop_DragDropMiscCode#_DragDrop_GetSpecificDataFormat_Native](~/samples/snippets/visualbasic/VS_Snippets_Wpf/DragDrop_DragDropMiscCode/visualbasic/window1.xaml.vb#_dragdrop_getspecificdataformat_native)] ## See also - - [Drag and Drop Overview](drag-and-drop-overview.md)