Spread ASP.NET 6.0 Product Documentation
DataMember Property
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : DataMember Property


Glossary Item Box

Gets or sets the data member for this sheet.

Syntax

Visual Basic (Declaration) 
Public Property DataMember As String
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim value As String
 
instance.DataMember = value
 
value = instance.DataMember
C# 
public string DataMember {get; set;}

Property Value

String containing the data member

Remarks

This property is available at run time only.

Example

This example binds the SheetView to a database using several of its properties.
C#Copy Code
    FarPoint.Web.Spread.SheetView sv = FpSpread1.ActiveSheetView;
    string conStr = "Provider=Microsoft.JET.OLEDB.4.0;data source=d:\\nwind.mdb";
    string sqlStr = "SELECT * FROM Employees";
    System.Data.OleDb.OleDbConnection conn  = new System.Data.OleDb.OleDbConnection(conStr);
    DataSet ds = new DataSet();
    System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter(sqlStr, conn);
    sv.DataMember = "Employees";
    da.Fill(ds, sv.DataMember);
    sv.DataSource = ds;
    conn.Close();
    sv.DataKeyField = "LastName";
Visual BasicCopy Code
    Dim sv As FarPoint.Web.Spread.SheetView
    sv = FpSpread1.ActiveSheetView
    Dim conStr As String = "Provider=Microsoft.JET.OLEDB.4.0;data source=d:\\nwind.mdb"
    Dim sqlStr As String = "SELECT * FROM Employees"
    Dim conn As System.Data.OleDb.OleDbConnection = New System.Data.OleDb.OleDbConnection(conStr)
    Dim ds As DataSet = New DataSet()
    Dim da As System.Data.OleDb.OleDbDataAdapter = New System.Data.OleDb.OleDbDataAdapter(sqlStr, conn)
    sv.DataMember = "Employees"
    da.Fill(ds, sv.DataMember)
    sv.DataSource = ds
    conn.Close()
    sv.DataKeyField = "LastName"

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.