Partager via


Code Snippet for getting a record from a binding source

For those who attended my SqlMobile webcast today, here is the code snippet I used to get the current record for a binding source. You may have to update the name of the bindingSource variable to match the name used in your application. To use this snippet save it to a text file called ".snippet" and put it in your My Documents\Visual Studio 2005\VB\My Code Snippets folder.

<?xml version="1.0" encoding="UTF-8"?>
<CodeSnippets xmlns="https://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Current Row From Binding Source</Title>
<Shortcut>CurrentRowFromBindingSource</Shortcut>
<Description>Code snippet for getting a DataRowView object out of the BindingSource.Current property</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Code Language="VB" Kind="method body">
<![CDATA[Dim currentRowView As System.Data.DataRowView = DVDsBindingSource.Current
Dim currentRow As DVDDataSet.DVDsRow = currentRowView.Row]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

Comments

  • Anonymous
    July 03, 2005
    &amp;nbsp;Wooo Hooo!&amp;nbsp;&amp;nbsp; TMM 100.&amp;nbsp; Thought I&amp;rsquo;d never get here at the rate I post &amp;lt;g&amp;gt;;...