IDataSourceContainerOptions.DataMember Property
Gets or sets a specific data member in a data source which contains several tables or members.
Namespace: DevExpress.XtraRichEdit
Assembly: DevExpress.RichEdit.v21.2.Core.dll
NuGet Package: DevExpress.RichEdit.Core
Declaration
Property Value
Type | Description |
---|---|
String | A string that identifies a member in the data source, such as the table name. |
Remarks
Use the DataMember property if the IDataSourceContainerOptions.DataSource property specifies a dataset which contains several data tables or other objects. If the data source is a single data table, data view or any custom created data source object, the DataMember is irrelevant.
Example
' Register a Snap data source and open a document template.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
' Load a template.
Me.snapControl1.Document.LoadDocument("template.snx", SnapDocumentFormat.Snap)
' After loading a template, add data sources to the collection.
Me.snapControl1.DataSources.Add("MyDS", CreateDataSource())
' And specify the data source used for mail merge (the Categories table of the MyDS data source).
Me.snapControl1.Options.SnapMailMergeVisualOptions.DataSourceName = "MyDS"
Me.snapControl1.Options.SnapMailMergeVisualOptions.DataMember = "Categories"
End Sub
Private Shared Function CreateDataSource() As Object
Dim ds As New DataSet()
Dim adapter As New SqlDataAdapter("SELECT * FROM Categories; SELECT * FROM Products", New SqlConnection(My.Settings.Default.NWindConnectionString))
adapter.TableMappings.Add("Table", "Categories")
adapter.TableMappings.Add("Table1", "Products")
adapter.Fill(ds)
ds.Relations.Add("CategoriesProducts", ds.Tables("Categories").Columns("CategoryId"), ds.Tables("Products").Columns("CategoryId"))
Return ds
End Function
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DataMember property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.