home *** CD-ROM | disk | FTP | other *** search
/ ftp.tcs3.com / ftp.tcs3.com.tar / ftp.tcs3.com / DRIVERS / Audio / Office2010 / InfoPath.en-us / InfLR.cab / FL_ConvertBindingSourceCurrenttoTypedRow_s_142626_ENU____.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Extensible Markup Language  |  2008-09-17  |  2KB  |  38 lines

  1. <?xml version="1.0"?>
  2. <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  3.   <CodeSnippet Format="1.0.0">
  4.     <Header>
  5.       <Title>Converts BindingSource.Current to a specific row in a DataTable</Title>
  6.       <Author>Microsoft Corporation</Author>
  7.       <Description>Gets the current row within a binding source and converts it to the specific row.  Recomended method for capturing the current, rather then using BindingSource.Position which may return a different row based on the sorting of the DataView</Description>
  8.       <Shortcut>dtBindingSourceCurrent</Shortcut>
  9.     </Header>
  10.     <Snippet>
  11.       <References>
  12.         <Reference>
  13.           <Assembly>System.Data</Assembly>
  14.         </Reference>
  15.         <Reference>
  16.           <Assembly>System.XML</Assembly>
  17.         </Reference>
  18.       </References>
  19.       <Declarations>
  20.         <Object>
  21.           <ID>rowType</ID>
  22.           <Type>DataRow</Type>
  23.           <ToolTip>Replace with the type for the DataRow from your dataset</ToolTip>
  24.           <Default>NorthwindDataSet.CustomersRow</Default>
  25.         </Object>
  26.         <Object>
  27.           <ID>bindingSource</ID>
  28.           <Type>BindingSource</Type>
  29.           <ToolTip>Replace with the BindingSource to capture the row from</ToolTip>
  30.           <Default>CustomersBindingSource</Default>
  31.         </Object>
  32.       </Declarations>
  33.       <Code Language="VB"><![CDATA[Dim row As $rowType$
  34. row = CType(CType(Me.$bindingSource$.Current, DataRowView).Row, $rowType$)
  35. ]]></Code>
  36.     </Snippet>
  37.   </CodeSnippet>
  38. </CodeSnippets>